Lines Matching refs:NULL

98     if (wbio == NULL || rbio == NULL) {  in OSSL_HTTP_REQ_CTX_new()
100 return NULL; in OSSL_HTTP_REQ_CTX_new()
103 if ((rctx = OPENSSL_zalloc(sizeof(*rctx))) == NULL) in OSSL_HTTP_REQ_CTX_new()
104 return NULL; in OSSL_HTTP_REQ_CTX_new()
111 if (rctx->buf == NULL) { in OSSL_HTTP_REQ_CTX_new()
113 return NULL; in OSSL_HTTP_REQ_CTX_new()
122 if (rctx == NULL) in OSSL_HTTP_REQ_CTX_free()
144 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_get0_mem_bio()
146 return NULL; in OSSL_HTTP_REQ_CTX_get0_mem_bio()
153 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_get_resp_len()
163 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_set_max_response_length()
179 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_set_request_line()
184 if ((rctx->mem = BIO_new(BIO_s_mem())) == NULL) in OSSL_HTTP_REQ_CTX_set_request_line()
191 if (server != NULL) { /* HTTP (but not HTTPS) proxy is used */ in OSSL_HTTP_REQ_CTX_set_request_line()
198 if (port != NULL && BIO_printf(rctx->mem, ":%s", port) <= 0) in OSSL_HTTP_REQ_CTX_set_request_line()
203 if (path == NULL) { in OSSL_HTTP_REQ_CTX_set_request_line()
206 if (server != NULL) { in OSSL_HTTP_REQ_CTX_set_request_line()
228 if (rctx == NULL || name == NULL) { in OSSL_HTTP_REQ_CTX_add1_header()
232 if (rctx->mem == NULL) { in OSSL_HTTP_REQ_CTX_add1_header()
239 if (value != NULL) { in OSSL_HTTP_REQ_CTX_add1_header()
252 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_set_expected()
264 rctx->expected_ct = NULL; in OSSL_HTTP_REQ_CTX_set_expected()
265 if (content_type != NULL in OSSL_HTTP_REQ_CTX_set_expected()
266 && (rctx->expected_ct = OPENSSL_strdup(content_type)) == NULL) in OSSL_HTTP_REQ_CTX_set_expected()
271 rctx->max_time = timeout > 0 ? time(NULL) + timeout : 0; in OSSL_HTTP_REQ_CTX_set_expected()
283 FILE *fp = NULL; in set1_content()
286 if (rctx == NULL || (req == NULL && content_type != NULL)) { in set1_content()
296 rctx->req = NULL; in set1_content()
297 if (req == NULL) in set1_content()
304 if (content_type == NULL) { in set1_content()
323 fp = NULL; in set1_content()
327 req_len = BIO_ctrl(req, BIO_CTRL_INFO, 0, NULL); in set1_content()
335 fp != NULL /* definitely correct req_len */ || in set1_content()
350 BIO *mem = NULL; in OSSL_HTTP_REQ_CTX_set1_req()
353 if (req != NULL) in OSSL_HTTP_REQ_CTX_set1_req()
354 res = (mem = ASN1_item_i2d_mem_bio(it, req)) != NULL; in OSSL_HTTP_REQ_CTX_set1_req()
363 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines()
374 int add_host = host != NULL && *host != '\0'; in add1_headers()
400 if (rctx == NULL) in http_req_ctx_new()
401 return NULL; in http_req_ctx_new()
406 if (proxy != NULL in http_req_ctx_new()
407 && (rctx->proxy = OPENSSL_strdup(proxy)) == NULL) in http_req_ctx_new()
409 if (server != NULL in http_req_ctx_new()
410 && (rctx->server = OPENSSL_strdup(server)) == NULL) in http_req_ctx_new()
412 if (port != NULL in http_req_ctx_new()
413 && (rctx->port = OPENSSL_strdup(port)) == NULL) in http_req_ctx_new()
416 overall_timeout > 0 ? time(NULL) + overall_timeout : 0; in http_req_ctx_new()
421 return NULL; in http_req_ctx_new()
527 time_t time_diff, now = time(NULL); in may_still_retry()
551 char *buf, *key, *value, *line_end = NULL; in OSSL_HTTP_REQ_CTX_nbio()
554 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_nbio()
558 if (rctx->mem == NULL || rctx->wbio == NULL || rctx->rbio == NULL) { in OSSL_HTTP_REQ_CTX_nbio()
563 rctx->redirection_url = NULL; in OSSL_HTTP_REQ_CTX_nbio()
635 if (rctx->req != NULL && !BIO_eof(rctx->req)) { in OSSL_HTTP_REQ_CTX_nbio()
742 if (value != NULL) { in OSSL_HTTP_REQ_CTX_nbio()
747 if (line_end == NULL) in OSSL_HTTP_REQ_CTX_nbio()
749 if (line_end != NULL) in OSSL_HTTP_REQ_CTX_nbio()
752 if (value != NULL && line_end != NULL) { in OSSL_HTTP_REQ_CTX_nbio()
761 && rctx->expected_ct != NULL) { in OSSL_HTTP_REQ_CTX_nbio()
766 && (strchr(rctx->expected_ct, ';') != NULL in OSSL_HTTP_REQ_CTX_nbio()
767 || (semicolon = strchr(value, ';')) == NULL in OSSL_HTTP_REQ_CTX_nbio()
839 if (rctx->expected_ct != NULL && !found_expected_ct) { in OSSL_HTTP_REQ_CTX_nbio()
906 n = BIO_get_mem_data(rctx->mem, NULL); in OSSL_HTTP_REQ_CTX_nbio()
921 *pval = NULL; in OSSL_HTTP_REQ_CTX_nbio_d2i()
924 *pval = ASN1_item_d2i(NULL, &p, BIO_get_mem_data(rctx->mem, &p), it); in OSSL_HTTP_REQ_CTX_nbio_d2i()
925 return *pval != NULL; in OSSL_HTTP_REQ_CTX_nbio_d2i()
933 if (port == NULL) { in explict_or_default_port()
934 char *service = NULL; in explict_or_default_port()
936 if (!BIO_parse_hostserv(hostserv, NULL, &service, BIO_PARSE_PRIO_HOST)) in explict_or_default_port()
937 return NULL; in explict_or_default_port()
938 if (service == NULL) /* implicit port */ in explict_or_default_port()
956 if (!ossl_assert(server != NULL)) in http_new_bio()
957 return NULL; in http_new_bio()
959 if (proxy != NULL) { in http_new_bio()
967 if (cbio == NULL) in http_new_bio()
969 if (port != NULL) in http_new_bio()
982 if (rctx == NULL) { in OSSL_HTTP_REQ_CTX_exchange()
984 return NULL; in OSSL_HTTP_REQ_CTX_exchange()
994 return NULL; in OSSL_HTTP_REQ_CTX_exchange()
998 if (rctx->redirection_url == NULL) { /* an error occurred */ in OSSL_HTTP_REQ_CTX_exchange()
1004 return NULL; in OSSL_HTTP_REQ_CTX_exchange()
1011 return rctx != NULL && rctx->keep_alive != 0; in OSSL_HTTP_is_alive()
1024 OSSL_HTTP_REQ_CTX *rctx = NULL; in OSSL_HTTP_open()
1026 if (use_ssl && bio_update_fn == NULL) { in OSSL_HTTP_open()
1028 return NULL; in OSSL_HTTP_open()
1030 if (rbio != NULL && (bio == NULL || bio_update_fn != NULL)) { in OSSL_HTTP_open()
1032 return NULL; in OSSL_HTTP_open()
1035 if (bio != NULL) { in OSSL_HTTP_open()
1037 if (proxy != NULL || no_proxy != NULL) { in OSSL_HTTP_open()
1039 return NULL; in OSSL_HTTP_open()
1043 char *proxy_host = NULL, *proxy_port = NULL; in OSSL_HTTP_open()
1045 if (server == NULL) { in OSSL_HTTP_open()
1047 return NULL; in OSSL_HTTP_open()
1049 if (port != NULL && *port == '\0') in OSSL_HTTP_open()
1050 port = NULL; in OSSL_HTTP_open()
1052 if (proxy != NULL in OSSL_HTTP_open()
1053 && !OSSL_HTTP_parse_url(proxy, NULL /* use_ssl */, NULL /* user */, in OSSL_HTTP_open()
1054 &proxy_host, &proxy_port, NULL /* num */, in OSSL_HTTP_open()
1055 NULL /* path */, NULL, NULL)) in OSSL_HTTP_open()
1056 return NULL; in OSSL_HTTP_open()
1060 if (cbio == NULL) in OSSL_HTTP_open()
1061 return NULL; in OSSL_HTTP_open()
1064 return NULL; in OSSL_HTTP_open()
1069 if (rbio == NULL && BIO_do_connect_retry(cbio, overall_timeout, -1) <= 0) { in OSSL_HTTP_open()
1070 if (bio == NULL) /* cbio was not provided by caller */ in OSSL_HTTP_open()
1078 if (bio_update_fn != NULL) { in OSSL_HTTP_open()
1082 if (cbio == NULL) { in OSSL_HTTP_open()
1083 if (bio == NULL) /* cbio was not provided by caller */ in OSSL_HTTP_open()
1089 rctx = http_req_ctx_new(bio == NULL, cbio, rbio != NULL ? rbio : cbio, in OSSL_HTTP_open()
1094 if (rctx != NULL) in OSSL_HTTP_open()
1111 if (rctx == NULL) { in OSSL_HTTP_set1_request()
1115 use_http_proxy = rctx->proxy != NULL && !rctx->use_ssl; in OSSL_HTTP_set1_request()
1116 if (use_http_proxy && rctx->server == NULL) { in OSSL_HTTP_set1_request()
1122 return OSSL_HTTP_REQ_CTX_set_request_line(rctx, req != NULL, in OSSL_HTTP_set1_request()
1124 : NULL, rctx->port, path) in OSSL_HTTP_set1_request()
1140 if (rctx == NULL) { in OSSL_HTTP_exchange()
1142 return NULL; in OSSL_HTTP_exchange()
1145 if (redirection_url != NULL) in OSSL_HTTP_exchange()
1146 *redirection_url = NULL; /* do this beforehand to prevent dbl free */ in OSSL_HTTP_exchange()
1149 if (resp == NULL) { in OSSL_HTTP_exchange()
1150 if (rctx->redirection_url != NULL) { in OSSL_HTTP_exchange()
1151 if (redirection_url == NULL) in OSSL_HTTP_exchange()
1170 if (rctx->server != NULL) { in OSSL_HTTP_exchange()
1173 rctx->port != NULL ? ":" : "", in OSSL_HTTP_exchange()
1174 rctx->port != NULL ? rctx->port : ""); in OSSL_HTTP_exchange()
1177 if (rctx->proxy != NULL) in OSSL_HTTP_exchange()
1189 if (resp != NULL && !BIO_up_ref(resp)) in OSSL_HTTP_exchange()
1190 resp = NULL; in OSSL_HTTP_exchange()
1224 BIO *resp = NULL; in OSSL_HTTP_get()
1225 time_t max_time = timeout > 0 ? time(NULL) + timeout : 0; in OSSL_HTTP_get()
1227 if (url == NULL) { in OSSL_HTTP_get()
1229 return NULL; in OSSL_HTTP_get()
1231 if ((current_url = OPENSSL_strdup(url)) == NULL) in OSSL_HTTP_get()
1232 return NULL; in OSSL_HTTP_get()
1238 if (!OSSL_HTTP_parse_url(current_url, &use_ssl, NULL /* user */, &host, in OSSL_HTTP_get()
1239 &port, NULL /* port_num */, &path, NULL, NULL)) in OSSL_HTTP_get()
1246 redirection_url = NULL; in OSSL_HTTP_get()
1247 if (rctx != NULL) { in OSSL_HTTP_get()
1249 NULL /* content_type */, in OSSL_HTTP_get()
1250 NULL /* req */, in OSSL_HTTP_get()
1255 rctx = NULL; in OSSL_HTTP_get()
1261 if (resp == NULL && redirection_url != NULL) { in OSSL_HTTP_get()
1269 if (path == NULL) { in OSSL_HTTP_get()
1275 return NULL; in OSSL_HTTP_get()
1289 if (!OSSL_HTTP_close(rctx, resp != NULL)) { in OSSL_HTTP_get()
1291 resp = NULL; in OSSL_HTTP_get()
1311 OSSL_HTTP_REQ_CTX *rctx = prctx == NULL ? NULL : *prctx; in OSSL_HTTP_transfer()
1312 BIO *resp = NULL; in OSSL_HTTP_transfer()
1314 if (rctx == NULL) { in OSSL_HTTP_transfer()
1320 if (rctx != NULL) { in OSSL_HTTP_transfer()
1324 resp = OSSL_HTTP_exchange(rctx, NULL); in OSSL_HTTP_transfer()
1325 if (resp == NULL || !OSSL_HTTP_is_alive(rctx)) { in OSSL_HTTP_transfer()
1326 if (!OSSL_HTTP_close(rctx, resp != NULL)) { in OSSL_HTTP_transfer()
1328 resp = NULL; in OSSL_HTTP_transfer()
1330 rctx = NULL; in OSSL_HTTP_transfer()
1333 if (prctx != NULL) in OSSL_HTTP_transfer()
1344 if (rctx != NULL && rctx->upd_fn != NULL) { in OSSL_HTTP_close()
1347 ret = wbio != NULL; in OSSL_HTTP_close()
1368 if (out == NULL) in base64encode()
1374 return NULL; in base64encode()
1396 time_t max_time = timeout > 0 ? time(NULL) + timeout : 0; in OSSL_HTTP_proxy_connect()
1398 if (bio == NULL || server == NULL in OSSL_HTTP_proxy_connect()
1399 || (bio_err != NULL && prog == NULL)) { in OSSL_HTTP_proxy_connect()
1403 if (port == NULL || *port == '\0') in OSSL_HTTP_proxy_connect()
1406 if (mbuf == NULL || fbio == NULL) { in OSSL_HTTP_proxy_connect()
1421 if (proxyuser != NULL) { in OSSL_HTTP_proxy_connect()
1423 char *proxyauth, *proxyauthenc = NULL; in OSSL_HTTP_proxy_connect()
1425 if (proxypass != NULL) in OSSL_HTTP_proxy_connect()
1428 if (proxyauth == NULL) in OSSL_HTTP_proxy_connect()
1431 proxypass != NULL ? proxypass : "") != (int)len) in OSSL_HTTP_proxy_connect()
1434 if (proxyauthenc != NULL) { in OSSL_HTTP_proxy_connect()
1440 if (proxyauthenc == NULL) in OSSL_HTTP_proxy_connect()
1520 if (fbio != NULL) { in OSSL_HTTP_proxy_connect()