mirror of
https://github.com/lammertb/libhttp.git
synced 2025-12-22 04:02:04 +03:00
Set request_info->uri for the client api functions (to the http server response code, as before)
This commit is contained in:
@@ -10401,6 +10401,7 @@ getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int mg_get_response(struct mg_connection *conn,
|
||||
char *ebuf,
|
||||
size_t ebuf_len,
|
||||
@@ -10425,6 +10426,10 @@ int mg_get_response(struct mg_connection *conn,
|
||||
ret = getreq(conn, ebuf, ebuf_len, &err);
|
||||
conn->ctx = octx;
|
||||
|
||||
/* TODO: 1) uri is deprecated;
|
||||
* 2) here, ri.uri is the http response code */
|
||||
conn->request_info.uri = conn->request_info.request_uri;
|
||||
|
||||
/* TODO (mid): Define proper return values - maybe return length?
|
||||
* For the first test use <0 for error and >0 for OK */
|
||||
return (ret == 0) ? -1 : +1;
|
||||
@@ -10432,6 +10437,7 @@ int mg_get_response(struct mg_connection *conn,
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
struct mg_connection *mg_download(const char *host,
|
||||
int port,
|
||||
int use_ssl,
|
||||
@@ -10462,6 +10468,10 @@ struct mg_connection *mg_download(const char *host,
|
||||
"Error sending request");
|
||||
} else {
|
||||
getreq(conn, ebuf, ebuf_len, &reqerr);
|
||||
|
||||
/* TODO: 1) uri is deprecated;
|
||||
* 2) here, ri.uri is the http response code */
|
||||
conn->request_info.uri = conn->request_info.request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10475,6 +10485,7 @@ struct mg_connection *mg_download(const char *host,
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
struct websocket_client_thread_data {
|
||||
struct mg_connection *conn;
|
||||
mg_websocket_data_handler data_handler;
|
||||
@@ -10482,6 +10493,7 @@ struct websocket_client_thread_data {
|
||||
void *callback_data;
|
||||
};
|
||||
|
||||
|
||||
#if defined(USE_WEBSOCKET)
|
||||
#ifdef _WIN32
|
||||
static unsigned __stdcall websocket_client_thread(void *data)
|
||||
|
||||
Reference in New Issue
Block a user