From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 8DD0A19C01E9 for ; Tue, 17 Nov 2015 16:48:58 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 7E5D3B5D87F for ; Tue, 17 Nov 2015 17:19:27 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id D4AB718CC7B5 for ; Tue, 17 Nov 2015 17:19:27 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 93D8A120446; Tue, 17 Nov 2015 17:19:25 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 8AF4A120439 for ; Tue, 17 Nov 2015 17:19:22 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=Qs6PCReGWIP8f3o4iGsbar2L6iM=; b=DErhT6FPfc3LdxC1w7 1NG6RUNUKSQTKKZrAYwlQCvSBt9NgqzbUtATve6OLamFDc8owgZsGyzvFSV0BW3k vkJw40Ty1YLwkcYhEirBpurq6UjP0DFkkgl4UlaZWLa+prwNEjmLoE8OTRjc1qNZ Esxr+u4JolKMgCVUjlhfQZ8XE= Received: by filter0420p1mdw1.sendgrid.net with SMTP id filter0420p1mdw1.24320.564AE30356 2015-11-17 08:19:15.902626903 +0000 UTC Received: from herokuapp.com (ec2-54-159-120-170.compute-1.amazonaws.com [54.159.120.170]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id G0qyjsdkTBKHlciFFk9xOw for ; Tue, 17 Nov 2015 08:19:15.649 +0000 (UTC) Date: Tue, 17 Nov 2015 08:19:15 +0000 From: akr@fsij.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46172 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11701 X-Redmine-Issue-Author: akr X-Redmine-Sender: akr X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6SH4XQzwHdXcEbNQ6P5Kcq7T2czntEXSCbaO SYs6rX2U1PXXgsn96IiLRSCvBzg66EQOARhgagDD9GHlwYdMvet9pNfOJyeRZcrNFvhgTE0TnUVIWu 8qAs4ttf3nmf+yed5d7wAVsJNhTlrz8Kgdp0 X-SendGrid-Contentd-ID: {"test_id":"1447748357"} X-ML-Name: ruby-core X-Mail-Count: 71517 Subject: [ruby-core:71517] [Ruby trunk - Bug #11701] [Open] recvmsg for UDP without argument X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11701 has been reported by Akira Tanaka. ---------------------------------------- Bug #11701: recvmsg for UDP without argument https://bugs.ruby-lang.org/issues/11701 * Author: Akira Tanaka * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- It seems recvmsg without argument doesn't work well for UDP now. Following example sends a packet which size is 10000 bytes but receives a packet which size is 4096 bytes. ``` % ./ruby -rsocket -ve 's1 = Addrinfo.udp("127.0.0.1", 0).bind s2 = s1.connect_address.connect s2.send("a"*10000, 0) ret = s1.recvmsg p ret[0].length ' ruby 2.3.0dev (2015-11-17 trunk 52613) [x86_64-linux] 4096 ``` ruby-2.3.0-preview1 worked well. It receives a packet which size is 10000 bytes. ``` % ruby-2.3.0-preview1 -rsocket -ve 's1 = Addrinfo.udp("127.0.0.1", 0).bind s2 = s1.connect_address.connect s2.send("a"*10000, 0) ret = s1.recvmsg p ret[0].length ' ruby 2.3.0preview1 (2015-11-11 trunk 52539) [x86_64-linux] 10000 ``` This behavior (recvmsg without arguments) is documented as follows: ``` maxmesglen and maxcontrollen can be nil. In that case, the buffer will be grown until the message is not truncated. Internally, MSG_PEEK is used and MSG_TRUNC/MSG_CTRUNC are checked. ``` -- https://bugs.ruby-lang.org/