[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-12 Thread masaori335
Github user masaori335 commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1438#discussion_r100724390
  
--- Diff: iocore/net/BIO_fastopen.cc ---
@@ -27,6 +27,67 @@
 
 #include "BIO_fastopen.h"
 
+// For BoringSSL, which for some reason doesn't have this function.
+// (In BoringSSL, sock_read() and sock_write() use the internal
+// bio_fd_non_fatal_error() instead.) #1437
+//
+// The following is copied from
+// 
https://github.com/openssl/openssl/blob/3befffa39dbaf2688d823fcf2bdfc07d2487be48/crypto/bio/bss_sock.c
--- End diff --

I understood. Let's add the attribution to the NOTICE file and use code 
from OpenSSL.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-12 Thread jablko
Github user jablko commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1438#discussion_r100697717
  
--- Diff: iocore/net/BIO_fastopen.cc ---
@@ -27,6 +27,67 @@
 
 #include "BIO_fastopen.h"
 
+// For BoringSSL, which for some reason doesn't have this function.
+// (In BoringSSL, sock_read() and sock_write() use the internal
+// bio_fd_non_fatal_error() instead.) #1437
+//
+// The following is copied from
+// 
https://github.com/openssl/openssl/blob/3befffa39dbaf2688d823fcf2bdfc07d2487be48/crypto/bio/bss_sock.c
--- End diff --

That works ... Is the purpose to avoid having to attribute it?

In general, I like to code for OpenSSL, and add fixes to make other 
environments conform to it -- unless there's a reason not to. So in this case 
I'd continue calling BIO_sock_non_fatal_error(), and copy it verbatim from 
OpenSSL if it's missing.

Functionally, your solution is equivalent (and cleaner!), but unless 
there's a reason not to use OpenSSL's function, that's the style I prefer. I'm 
happy either way, though :-)

I'll open a PR to add attribution to the NOTICE file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-10 Thread masaori335
Github user masaori335 commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1438#discussion_r100647168
  
--- Diff: iocore/net/BIO_fastopen.cc ---
@@ -27,6 +27,67 @@
 
 #include "BIO_fastopen.h"
 
+// For BoringSSL, which for some reason doesn't have this function.
+// (In BoringSSL, sock_read() and sock_write() use the internal
+// bio_fd_non_fatal_error() instead.) #1437
+//
+// The following is copied from
+// 
https://github.com/openssl/openssl/blob/3befffa39dbaf2688d823fcf2bdfc07d2487be48/crypto/bio/bss_sock.c
--- End diff --

How about just add a function like this? We don't support WINDOWS and don't 
need those "#ifdef". Just checking error codes looks enough.
```
static int
non_fetal_error(int err)
{
  if (err == EWOULDBLOCK || err == ENOTCONN || err == EINTR || err == 
EAGAIN || err == EPROTO || err == EINPROGRESS || err == EALREADY) {
return 1;
  }
  return 0;
}
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-10 Thread masaori335
Github user masaori335 commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1438#discussion_r100646468
  
--- Diff: iocore/net/BIO_fastopen.cc ---
@@ -27,6 +27,67 @@
 
 #include "BIO_fastopen.h"
 
+// For BoringSSL, which for some reason doesn't have this function.
+// (In BoringSSL, sock_read() and sock_write() use the internal
+// bio_fd_non_fatal_error() instead.) #1437
+//
+// The following is copied from
+// 
https://github.com/openssl/openssl/blob/3befffa39dbaf2688d823fcf2bdfc07d2487be48/crypto/bio/bss_sock.c
--- End diff --

It looks like we need to add "OpenSSL License" in LICENSE file, because 
this is just copy.
(Sorry for I should have noticed this before merge) 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-10 Thread masaori335
Github user masaori335 closed the pull request at:

https://github.com/apache/trafficserver/pull/1438


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1438: BoringSSL doesn't have BIO_sock_non_fatal_...

2017-02-10 Thread jablko
GitHub user jablko opened a pull request:

https://github.com/apache/trafficserver/pull/1438

BoringSSL doesn't have BIO_sock_non_fatal_error()

Fixes #1437

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jablko/trafficserver non_fatal_error

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafficserver/pull/1438.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1438






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---