mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge remote-tracking branch 'origin/patches-2.0'
This commit is contained in:
commit
4df9b43305
10
http.c
10
http.c
@ -3309,8 +3309,11 @@ evhttp_new_object(void)
|
|||||||
struct evhttp *
|
struct evhttp *
|
||||||
evhttp_new(struct event_base *base)
|
evhttp_new(struct event_base *base)
|
||||||
{
|
{
|
||||||
struct evhttp *http = evhttp_new_object();
|
struct evhttp *http = NULL;
|
||||||
|
|
||||||
|
http = evhttp_new_object();
|
||||||
|
if (http == NULL)
|
||||||
|
return (NULL);
|
||||||
http->base = base;
|
http->base = base;
|
||||||
|
|
||||||
return (http);
|
return (http);
|
||||||
@ -3323,8 +3326,11 @@ evhttp_new(struct event_base *base)
|
|||||||
struct evhttp *
|
struct evhttp *
|
||||||
evhttp_start(const char *address, unsigned short port)
|
evhttp_start(const char *address, unsigned short port)
|
||||||
{
|
{
|
||||||
struct evhttp *http = evhttp_new_object();
|
struct evhttp *http = NULL;
|
||||||
|
|
||||||
|
http = evhttp_new_object();
|
||||||
|
if (http == NULL)
|
||||||
|
return (NULL);
|
||||||
if (evhttp_bind_socket(http, address, port) == -1) {
|
if (evhttp_bind_socket(http, address, port) == -1) {
|
||||||
mm_free(http);
|
mm_free(http);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user