X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspsocket.cpp;h=ee5287e5f33888e0cd24b46f0ce68979cf2d33f9;hb=30bcf4894f1da0db8dde15329260c801f748a019;hp=645947f56e925c2a37157e9f76932d3c4f96d416;hpb=38bc192dd6d289b8632349c67ef2cafdca3b4159;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 645947f56..ee5287e5f 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -339,15 +339,17 @@ void StreamSocket::DoWrite() } int rv_max = 0; - iovec* iovecs = new iovec[bufcount]; - for(int i=0; i < bufcount; i++) + int rv; { - iovecs[i].iov_base = const_cast(sendq[i].data()); - iovecs[i].iov_len = sendq[i].length(); - rv_max += sendq[i].length(); + iovec iovecs[MYIOV_MAX]; + for (int i = 0; i < bufcount; i++) + { + iovecs[i].iov_base = const_cast(sendq[i].data()); + iovecs[i].iov_len = sendq[i].length(); + rv_max += sendq[i].length(); + } + rv = writev(fd, iovecs, bufcount); } - int rv = writev(fd, iovecs, bufcount); - delete[] iovecs; if (rv == (int)sendq_len) {