Skip to content

Commit b64d2f2

Browse files
committed
Remove useless code
1 parent 4eed1a6 commit b64d2f2

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

ext-src/swoole_client_coro.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ static PHP_METHOD(swoole_client_coro, connect) {
526526
Z_PARAM_OPTIONAL
527527
Z_PARAM_LONG(port)
528528
Z_PARAM_DOUBLE(timeout)
529-
Z_PARAM_LONG(sock_flag)
530529
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
531530

532531
if (host_len == 0) {
@@ -553,7 +552,7 @@ static PHP_METHOD(swoole_client_coro, connect) {
553552
}
554553

555554
cli->set_timeout(timeout, Socket::TIMEOUT_CONNECT);
556-
if (!cli->connect(host, port, sock_flag)) {
555+
if (!cli->connect(host, port)) {
557556
zend_update_property_long(swoole_client_coro_ce, SW_Z8_OBJ_P(ZEND_THIS), ZEND_STRL("errCode"), cli->errCode);
558557
zend_update_property_string(swoole_client_coro_ce, SW_Z8_OBJ_P(ZEND_THIS), ZEND_STRL("errMsg"), cli->errMsg);
559558
client_coro_close(ZEND_THIS);

include/swoole_coroutine_socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Socket {
6363
Socket(enum swSocket_type type = SW_SOCK_TCP);
6464
Socket(int _fd, enum swSocket_type _type);
6565
~Socket();
66-
bool connect(std::string host, int port, int flags = 0);
66+
bool connect(std::string host, int port);
6767
bool connect(const struct sockaddr *addr, socklen_t addrlen);
6868
bool shutdown(int how = SHUT_RDWR);
6969
bool cancel(const enum swEvent_type event);

src/coroutine/socket.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ bool Socket::connect(const struct sockaddr *addr, socklen_t addrlen) {
595595
return true;
596596
}
597597

598-
bool Socket::connect(std::string _host, int _port, int flags) {
598+
bool Socket::connect(std::string _host, int _port) {
599599
if (sw_unlikely(!is_available(SW_EVENT_RDWR))) {
600600
return false;
601601
}

0 commit comments

Comments
 (0)