{"id":805945,"url":"http://patchwork.ozlabs.org/api/patches/805945/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/1503673364-3166-3-git-send-email-abalutoiu@cloudbasesolutions.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1503673364-3166-3-git-send-email-abalutoiu@cloudbasesolutions.com>","list_archive_url":null,"date":"2017-08-25T15:02:57","name":"[ovs-dev,2/2] windows,python: remove unnecessary code","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"0e0deb19cee90efd4be0e22a9cf190aeb898a5d8","submitter":{"id":70688,"url":"http://patchwork.ozlabs.org/api/people/70688/?format=json","name":"Alin Balutoiu","email":"abalutoiu@cloudbasesolutions.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/1503673364-3166-3-git-send-email-abalutoiu@cloudbasesolutions.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/805945/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/805945/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","ovs-dev@mail.linuxfoundation.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)","Received":["from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xf4Fv155tz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 26 Aug 2017 01:04:51 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id 77B3DB2A;\n\tFri, 25 Aug 2017 15:03:37 +0000 (UTC)","from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 735DCB08\n\tfor <dev@openvswitch.org>; Fri, 25 Aug 2017 15:03:35 +0000 (UTC)","from mail.cloudbasesolutions.com (mail.cloudbasesolutions.com\n\t[91.232.152.5])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTP id 9C1ED135\n\tfor <dev@openvswitch.org>; Fri, 25 Aug 2017 15:02:59 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby mail.cloudbasesolutions.com (Postfix) with ESMTP id D59B041C63\n\tfor <dev@openvswitch.org>; Fri, 25 Aug 2017 18:02:58 +0300 (EEST)","from mail.cloudbasesolutions.com ([127.0.0.1])\n\tby localhost (mail.cloudbasesolutions.com [127.0.0.1]) (amavisd-new, \n\tport 10024) with ESMTP id 5RGaYtpZou_E for <dev@openvswitch.org>;\n\tFri, 25 Aug 2017 18:02:58 +0300 (EEST)","from mail.cloudbasesolutions.com (unknown [10.77.78.3])\n\tby mail.cloudbasesolutions.com (Postfix) with ESMTP id 8F55D4164E\n\tfor <dev@openvswitch.org>; Fri, 25 Aug 2017 18:02:58 +0300 (EEST)","from CBSEX1.cloudbase.local ([10.77.78.3]) by\n\tCBSEX1.cloudbase.local ([10.77.78.3]) with mapi id 14.03.0361.001;\n\tFri, 25 Aug 2017 17:02:58 +0200"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-Virus-Scanned":"amavisd-new at cloudbasesolutions.com","From":"Alin Balutoiu <abalutoiu@cloudbasesolutions.com>","To":"\"dev@openvswitch.org\" <dev@openvswitch.org>","Thread-Topic":"[PATCH 2/2] windows,python: remove unnecessary code","Thread-Index":"AQHTHbM87x7hz+L9Lky/Ye13nHt+cQ==","Date":"Fri, 25 Aug 2017 15:02:57 +0000","Message-ID":"<1503673364-3166-3-git-send-email-abalutoiu@cloudbasesolutions.com>","References":"<1503673364-3166-1-git-send-email-abalutoiu@cloudbasesolutions.com>","In-Reply-To":"<1503673364-3166-1-git-send-email-abalutoiu@cloudbasesolutions.com>","Accept-Language":"en-US, it-IT","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-originating-ip":"[10.77.78.1]","MIME-Version":"1.0","X-Spam-Status":"No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD\n\tautolearn=unavailable version=3.3.1","X-Spam-Checker-Version":"SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org","Subject":"[ovs-dev] [PATCH 2/2] windows,python: remove unnecessary code","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.12","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"},"content":"At the moment we have WSAEventSelect in each if branch.\n\nSince the call to the function is similar, we can move\nit outside the if branch and create some local variables\nwhich will be passed to WSAEventSelect.\n\nThis patch also remove the keyword argument passed when\nthe event for the connection overlapped structure is created.\nThe argument is not needed since it does not change the value\nfrom the default one.\n\nSigned-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>\n---\n python/ovs/stream.py | 41 ++++++++++++++++++-----------------------\n 1 file changed, 18 insertions(+), 23 deletions(-)","diff":"diff --git a/python/ovs/stream.py b/python/ovs/stream.py\nindex 9d0536d..cb1cdbe 100644\n--- a/python/ovs/stream.py\n+++ b/python/ovs/stream.py\n@@ -457,29 +457,24 @@ class Stream(object):\n     def __wait_windows(self, poller, wait):\n         if self.socket is not None:\n             if wait == Stream.W_RECV:\n-                read_flags = (win32file.FD_READ |\n-                              win32file.FD_ACCEPT |\n-                              win32file.FD_CLOSE)\n-                try:\n-                    win32file.WSAEventSelect(self.socket,\n-                                             self._wevent,\n-                                             read_flags)\n-                except pywintypes.error as e:\n-                    vlog.err(\"failed to associate events with socket: %s\"\n-                             % e.strerror)\n-                poller.fd_wait(self._wevent, ovs.poller.POLLIN)\n+                mask = (win32file.FD_READ |\n+                        win32file.FD_ACCEPT |\n+                        win32file.FD_CLOSE)\n+                event = ovs.poller.POLLIN\n             else:\n-                write_flags = (win32file.FD_WRITE |\n-                               win32file.FD_CONNECT |\n-                               win32file.FD_CLOSE)\n-                try:\n-                    win32file.WSAEventSelect(self.socket,\n-                                             self._wevent,\n-                                             write_flags)\n-                except pywintypes.error as e:\n-                    vlog.err(\"failed to associate events with socket: %s\"\n-                             % e.strerror)\n-                poller.fd_wait(self._wevent, ovs.poller.POLLOUT)\n+                mask = (win32file.FD_WRITE |\n+                        win32file.FD_CONNECT |\n+                        win32file.FD_CLOSE)\n+                event = ovs.poller.POLLOUT\n+\n+            try:\n+                win32file.WSAEventSelect(self.socket,\n+                                         self._wevent,\n+                                         mask)\n+            except pywintypes.error as e:\n+                vlog.err(\"failed to associate events with socket: %s\"\n+                         % e.strerror)\n+            poller.fd_wait(self._wevent, event)\n         else:\n             if wait == Stream.W_RECV:\n                 if self._read:\n@@ -549,7 +544,7 @@ class PassiveStream(object):\n         self.socket = sock\n         if pipe is not None:\n             self.connect = pywintypes.OVERLAPPED()\n-            self.connect.hEvent = winutils.get_new_event(bManualReset=True)\n+            self.connect.hEvent = winutils.get_new_event()\n             self.connect_pending = False\n             suffix = name.split(\":\", 1)[1]\n             suffix = ovs.util.abs_file_name(ovs.dirs.RUNDIR, suffix)\n","prefixes":["ovs-dev","2/2"]}