Loading docs/libcurl/curl_easy_getinfo.3 +8 −6 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms Loading Loading @@ -44,11 +44,13 @@ The following information can be extracted: .IP CURLINFO_EFFECTIVE_URL Pass a pointer to a char pointer to receive the last used effective URL. .IP CURLINFO_RESPONSE_CODE Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not this. Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not this. Support for SMTP responses added in 7.25.0. .IP CURLINFO_HTTP_CONNECTCODE Pass a pointer to a long to receive the last received proxy response code to a CONNECT request. Loading lib/smtp.c +6 −3 Original line number Diff line number Diff line Loading @@ -1108,6 +1108,10 @@ static CURLcode smtp_statemach_act(struct connectdata *conn) if(result) return result; if(smtpc->state != SMTP_QUIT) /* store the latest code for later retrieval */ data->info.httpcode = smtpcode; if(smtpcode) { /* we have now received a full SMTP server response */ switch(smtpc->state) { Loading Loading @@ -1524,6 +1528,7 @@ static CURLcode smtp_quit(struct connectdata *conn) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT"); if(result) return result; state(conn, SMTP_QUIT); result = smtp_easy_statemach(conn); Loading Loading @@ -1564,7 +1569,6 @@ static CURLcode smtp_disconnect(struct connectdata *conn, /* This won't already be freed in some error cases */ Curl_safefree(smtpc->domain); smtpc->domain = NULL; return CURLE_OK; } Loading @@ -1581,8 +1585,7 @@ static CURLcode smtp_dophase_done(struct connectdata *conn, /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); free(smtpc->domain); smtpc->domain = NULL; Curl_safefree(smtpc->domain); return CURLE_OK; } Loading Loading
docs/libcurl/curl_easy_getinfo.3 +8 −6 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms Loading Loading @@ -44,11 +44,13 @@ The following information can be extracted: .IP CURLINFO_EFFECTIVE_URL Pass a pointer to a char pointer to receive the last used effective URL. .IP CURLINFO_RESPONSE_CODE Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not this. Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not this. Support for SMTP responses added in 7.25.0. .IP CURLINFO_HTTP_CONNECTCODE Pass a pointer to a long to receive the last received proxy response code to a CONNECT request. Loading
lib/smtp.c +6 −3 Original line number Diff line number Diff line Loading @@ -1108,6 +1108,10 @@ static CURLcode smtp_statemach_act(struct connectdata *conn) if(result) return result; if(smtpc->state != SMTP_QUIT) /* store the latest code for later retrieval */ data->info.httpcode = smtpcode; if(smtpcode) { /* we have now received a full SMTP server response */ switch(smtpc->state) { Loading Loading @@ -1524,6 +1528,7 @@ static CURLcode smtp_quit(struct connectdata *conn) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT"); if(result) return result; state(conn, SMTP_QUIT); result = smtp_easy_statemach(conn); Loading Loading @@ -1564,7 +1569,6 @@ static CURLcode smtp_disconnect(struct connectdata *conn, /* This won't already be freed in some error cases */ Curl_safefree(smtpc->domain); smtpc->domain = NULL; return CURLE_OK; } Loading @@ -1581,8 +1585,7 @@ static CURLcode smtp_dophase_done(struct connectdata *conn, /* no data to transfer */ Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); free(smtpc->domain); smtpc->domain = NULL; Curl_safefree(smtpc->domain); return CURLE_OK; } Loading