Skip to content
This repository was archived by the owner on May 9, 2021. It is now read-only.

Commit cd05095

Browse files
authored
Fix threads safety (#4)
* Update HttpseRequest.c * Update HttpseRuleset.h
1 parent 42be44f commit cd05095

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/HttpseRequest.c

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ HttpseRequest_init(const char *url, const HttpseRequestOptions *options)
3939
HTTPSE_CURL_SETOPT(rq->curl, WRITEFUNCTION, HttpseVector_append);
4040
HTTPSE_CURL_SETOPT(rq->curl, HEADERDATA, rq->hd);
4141
HTTPSE_CURL_SETOPT(rq->curl, HEADERFUNCTION, HttpseVector_append);
42+
43+
/* Remark: See https://curl.haxx.se/libcurl/c/multithread.html */
44+
HTTPSE_CURL_SETOPT(rq->curl, NOSIGNAL, 1L);
4245

4346
/* Remark: curl_easy_setopt() */
4447
HTTPSE_CURL_SETOPT(rq->curl, ACCEPT_ENCODING,

src/HttpseRuleset.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef struct HttpseRulesetOptions
6969
.securecookie = 0L, \
7070
.output = NULL, \
7171
.options = kHttpseRequestOptions, \
72-
.num_threads = 1L, \
72+
.num_threads = 4L, \
7373
}
7474
#endif
7575

0 commit comments

Comments
 (0)