Skip to content

Commit bc6aa4f

Browse files
committed
refactor: remove unnecessary macro
1 parent 729a225 commit bc6aa4f

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/errors.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
ereport(ERROR, errmsg("Could not curl_multi_setopt(%s)", #opt)); \
2020
} while (0)
2121

22-
#define EREPORT_CURL_MULTI_ASSIGN(multi_handle, sockfd, sockp) \
23-
do { \
24-
CURLMcode mresult = curl_multi_assign(multi_handle, sockfd, sockp); \
25-
if (mresult != CURLM_OK) \
26-
ereport(ERROR, errmsg("Could not curl_multi_assign(%s)", curl_multi_strerror(mresult))); \
27-
} while (0)
28-
2922
#define EREPORT_CURL_SLIST_APPEND(list, str) \
3023
do { \
3124
struct curl_slist *new_list = curl_slist_append(list, str); \

src/event.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ int multi_socket_cb(__attribute__((unused)) CURL *easy, curl_socket_t sockfd, in
9494
int epoll_op;
9595
if (!socketp) {
9696
epoll_op = EPOLL_CTL_ADD;
97-
EREPORT_CURL_MULTI_ASSIGN(wstate->curl_mhandle, sockfd, &socketp_marker);
97+
EREPORT_MULTI(curl_multi_assign(wstate->curl_mhandle, sockfd, &socketp_marker));
9898
} else if (what == CURL_POLL_REMOVE) {
9999
epoll_op = EPOLL_CTL_DEL;
100-
EREPORT_CURL_MULTI_ASSIGN(wstate->curl_mhandle, sockfd, NULL);
100+
EREPORT_MULTI(curl_multi_assign(wstate->curl_mhandle, sockfd, NULL));
101101
} else {
102102
epoll_op = EPOLL_CTL_MOD;
103103
}
@@ -200,7 +200,7 @@ int multi_socket_cb(__attribute__((unused)) CURL *easy, curl_socket_t sockfd, in
200200
sock_info = palloc(sizeof(SocketInfo));
201201
sock_info->sockfd = sockfd;
202202
sock_info->action = CURL_POLL_NONE;
203-
EREPORT_CURL_MULTI_ASSIGN(wstate->curl_mhandle, sockfd, sock_info);
203+
EREPORT_MULTI(curl_multi_assign(wstate->curl_mhandle, sockfd, sock_info));
204204
}
205205

206206
UPDATE_FILTER(CURL_POLL_IN, EVFILT_READ);
@@ -209,7 +209,7 @@ int multi_socket_cb(__attribute__((unused)) CURL *easy, curl_socket_t sockfd, in
209209
sock_info->action = what;
210210

211211
if (what == CURL_POLL_REMOVE) {
212-
EREPORT_CURL_MULTI_ASSIGN(wstate->curl_mhandle, sockfd, NULL);
212+
EREPORT_MULTI(curl_multi_assign(wstate->curl_mhandle, sockfd, NULL));
213213
pfree(sock_info);
214214
}
215215

0 commit comments

Comments
 (0)