RestComm / jain-sip

Disclaimer: This repository is a git-svn mirror of the project found at http://java.net/projects/jsip whose original repository is developed collaboratively by the Advanced Networking Technologies Division at the National Institute of Standards and Technology (NIST) - an agency of the United States Department of Commerce and by a community of individual and enterprise contributors. TeleStax, Inc. will perform some productization work, new features experimentation branches, etc for its TelScale jSIP product that doesn't concern the community from the main repository hence this git repository.
http://www.restcomm.com/
144 stars 152 forks source link

Avoid sending double CRLF keep alive on TCP socket shutdown #172

Open fre42 opened 6 years ago

fre42 commented 6 years ago

The current implementation does send a duplicate CRLF in the case of a TCP/TLS connection shutdown (socket closed). This leads to the situation that the PipelinedMsgParser handles it as "RFC 5626 CRLF keepalive mechanism" and tries to send a single CRLF. This sending will of course fail because the socket is closed. Due to a race condition when closing the socket, sometimes this will lead to the error message "A problem occured while trying to send a single CRLF in response to a double CRLF" which is no error. By the way I've fixed a small typo: "CRLF" was sometimes "CLRF" in log messages an in the code.

gsaslis commented 6 years ago

@fre42 Thanks for submitting the PR ❤️ - really appreciate you taking the time to contribute this!!

Could you please take a look at our Open Source Playbook and then proceed with signing our CLA, so we can then move forward with properly reviewing this?

Thanks in advance! Yorgos

fre42 commented 6 years ago

I need to clarify with my company if I'm allowed to sign the CLA. Unfortunately this may take some time.

gsaslis commented 6 years ago

@fre42 sure thing.

Please take your time, so we can make sure we do this properly.

fre42 commented 6 years ago

Where can I find this CLA? I've found the link https://www.restcomm.com/contributor-license-agreement/#Contribute. The CLA is mentioned there but not linked.

gsaslis commented 6 years ago

@fre42 sorry for the delay in getting back to you on this.

The CLA is available on that page "inside" the form... you have to select "Individual" or "Corporate" on the form at the bottom of the page for the CLA text to come up.

(I know it's not ideal, won't be long before we integrate CLA signing as part of the PR flow)

fre42 commented 6 years ago

@gsaslis Meanwhile I've got feedback from my company's legal department. They have concerns signing the CLA as it is: From a legal standpoint, the license is worded to grant

"… Telestax, its successors and assigns the non-exclusive, transferable, irrevocable, perpetual, royalty-free right to use, modify, copy, sell, distribute”, “without limitation”

, any of our patents that may be included in a contribution, i.e. not tied to the contribution. OSS licenses usually contain wording to limit such license to the use of the contribution within the license terms, see below example from the EPL 1.0 license. Eclipse Public License 1.0, section 2 b):

Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution.

They don’t think that this was the intention of Telestax, however, it is what the agreement says. We would therefore be o.k. to agree on limiting terms, e.g.:

This grant is made with respect to any copyright, patent or other intellectual property or moral rights (together: “IPR”) Contributor may have in or to the Contributions, as far as the exercise of the rights granted in the preceding sentence would otherwise infringe such IPR.

Would such an individual CLA be OK for you?

gsaslis commented 6 years ago

@fre42 thanks for bringing that to my attention - will check internally and let you know asap.

gsaslis commented 6 years ago

@fre42 sorry for the delay here - can you please drop me an email at yorgos.saslis youKnowWhatGoesHere telestax.com, so we can continue this discussion and not take this thread off-topic?