diff options
author | Alan Kligman <ack@mozilla.com> | 2013-05-30 20:59:16 -0400 |
---|---|---|
committer | Alan Kligman <ack@mozilla.com> | 2013-05-30 20:59:16 -0400 |
commit | 92b7475e2796e6827da7efaa8d96b7cd7f321e40 (patch) | |
tree | 70cf95b65b8db83b28cd2c96d8b1ff00693932b6 | |
parent | 80decaceb1371a5eb54a4b55b140bc8f4f8259b5 (diff) |
Fixed formatting.
-rw-r--r-- | src/library.js | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/library.js b/src/library.js index 7f9ae6e5..6f85669e 100644 --- a/src/library.js +++ b/src/library.js @@ -7236,7 +7236,7 @@ LibraryManager.library = { }; function handleMessage(addr, message) { #if SOCKET_DEBUG - Module.print("received " + message.byteLength + " raw bytes"); + Module.print("received " + message.byteLength + " raw bytes"); #endif var header = new Uint16Array(message, 0, 2); if (Sockets.portmap[header[1]]) { @@ -7356,7 +7356,7 @@ LibraryManager.library = { var iov = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_iov', 'i8*') }}}; var num = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_iovlen', 'i32') }}}; #if SOCKET_DEBUG - Module.print('sendmsg vecs: ' + num); + Module.print('sendmsg vecs: ' + num); #endif var totalSize = 0; for (var i = 0; i < num; i++) { @@ -7367,7 +7367,7 @@ LibraryManager.library = { for (var i = 0; i < num; i++) { var currNum = {{{ makeGetValue('iov', '8*i + 4', 'i32') }}}; #if SOCKET_DEBUG - Module.print('sendmsg curr size: ' + currNum); + Module.print('sendmsg curr size: ' + currNum); #endif if (!currNum) continue; var currBuf = {{{ makeGetValue('iov', '8*i', 'i8*') }}}; @@ -7378,8 +7378,8 @@ LibraryManager.library = { info.header[0] = info.port; // src port info.header[1] = port; // dst port #if SOCKET_DEBUG - Module.print('sendmsg port: ' + info.header[0] + ' -> ' + info.header[1]); - Module.print('sendmsg bytes: ' + data.length + ' | ' + Array.prototype.slice.call(data)); + Module.print('sendmsg port: ' + info.header[0] + ' -> ' + info.header[1]); + Module.print('sendmsg bytes: ' + data.length + ' | ' + Array.prototype.slice.call(data)); #endif var buffer = new Uint8Array(info.header.byteLength + data.byteLength); buffer.set(new Uint8Array(info.header.buffer)); @@ -7410,8 +7410,8 @@ LibraryManager.library = { var bytes = buffer.length; #if SOCKET_DEBUG - Module.print('recvmsg port: ' + header[1] + ' <- ' + header[0]); - Module.print('recvmsg bytes: ' + bytes + ' | ' + Array.prototype.slice.call(buffer)); + Module.print('recvmsg port: ' + header[1] + ' <- ' + header[0]); + Module.print('recvmsg bytes: ' + bytes + ' | ' + Array.prototype.slice.call(buffer)); #endif // write source var name = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_name', '*') }}}; @@ -7425,14 +7425,14 @@ LibraryManager.library = { for (var i = 0; i < num && bytes > 0; i++) { var currNum = {{{ makeGetValue('iov', '8*i + 4', 'i32') }}}; #if SOCKET_DEBUG - Module.print('recvmsg loop ' + [i, num, bytes, currNum]); + Module.print('recvmsg loop ' + [i, num, bytes, currNum]); #endif if (!currNum) continue; currNum = Math.min(currNum, bytes); // XXX what should happen when we partially fill a buffer..? bytes -= currNum; var currBuf = {{{ makeGetValue('iov', '8*i', 'i8*') }}}; #if SOCKET_DEBUG - Module.print('recvmsg call recv ' + currNum); + Module.print('recvmsg call recv ' + currNum); #endif HEAPU8.set(buffer.subarray(bufferPos, bufferPos + currNum), currBuf); bufferPos += currNum; @@ -7581,7 +7581,7 @@ LibraryManager.library = { assert(typeof event.data !== 'string' && event.data.byteLength); // must get binary data! var data = new Uint8Array(event.data); // make a typed array view on the array buffer #if SOCKET_DEBUG - Module.print(['onmessage', data.length, '|', Array.prototype.slice.call(data)]); + Module.print(['onmessage', data.length, '|', Array.prototype.slice.call(data)]); #endif if (info.stream) { info.inQueue.push(data); @@ -7606,7 +7606,7 @@ LibraryManager.library = { } currPos += 4; #if SOCKET_DEBUG - Module.print(['onmessage message', currLen, '|', Array.prototype.slice.call(data.subarray(currPos, currPos+currLen))]); + Module.print(['onmessage message', currLen, '|', Array.prototype.slice.call(data.subarray(currPos, currPos+currLen))]); #endif info.inQueue.push(data.subarray(currPos, currPos+currLen)); currPos += currLen; @@ -7620,7 +7620,7 @@ LibraryManager.library = { function send(data) { // TODO: if browser accepts views, can optimize this #if SOCKET_DEBUG - Module.print('sender actually sending ' + Array.prototype.slice.call(data)); + Module.print('sender actually sending ' + Array.prototype.slice.call(data)); #endif // ok to use the underlying buffer, we created data and know that the buffer starts at the beginning info.socket.send(data.buffer); @@ -7675,14 +7675,14 @@ LibraryManager.library = { } var buffer = info.inQueue.shift(); #if SOCKET_DEBUG - Module.print('recv: ' + [Array.prototype.slice.call(buffer)]); + Module.print('recv: ' + [Array.prototype.slice.call(buffer)]); #endif if (len < buffer.length) { if (info.stream) { // This is tcp (reliable), so if not all was read, keep it info.inQueue.unshift(buffer.subarray(len)); #if SOCKET_DEBUG - Module.print('recv: put back: ' + (len - buffer.length)); + Module.print('recv: put back: ' + (len - buffer.length)); #endif } buffer = buffer.subarray(0, len); @@ -7712,7 +7712,7 @@ LibraryManager.library = { var iov = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_iov', 'i8*') }}}; var num = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_iovlen', 'i32') }}}; #if SOCKET_DEBUG - Module.print('sendmsg vecs: ' + num); + Module.print('sendmsg vecs: ' + num); #endif var totalSize = 0; for (var i = 0; i < num; i++) { @@ -7723,7 +7723,7 @@ LibraryManager.library = { for (var i = 0; i < num; i++) { var currNum = {{{ makeGetValue('iov', '8*i + 4', 'i32') }}}; #if SOCKET_DEBUG - Module.print('sendmsg curr size: ' + currNum); + Module.print('sendmsg curr size: ' + currNum); #endif if (!currNum) continue; var currBuf = {{{ makeGetValue('iov', '8*i', 'i8*') }}}; @@ -7741,7 +7741,7 @@ LibraryManager.library = { // if we are not connected, use the address info in the message if (!info.connected) { #if SOCKET_DEBUG - Module.print('recvmsg connecting'); + Module.print('recvmsg connecting'); #endif var name = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_name', '*') }}}; assert(name, 'sendmsg on non-connected socket, and no name/address in the message'); @@ -7754,7 +7754,7 @@ LibraryManager.library = { var buffer = info.inQueue.shift(); var bytes = buffer.length; #if SOCKET_DEBUG - Module.print('recvmsg bytes: ' + bytes); + Module.print('recvmsg bytes: ' + bytes); #endif // write source var name = {{{ makeGetValue('msg', 'Sockets.msghdr_layout.msg_name', '*') }}}; @@ -7768,14 +7768,14 @@ LibraryManager.library = { for (var i = 0; i < num && bytes > 0; i++) { var currNum = {{{ makeGetValue('iov', '8*i + 4', 'i32') }}}; #if SOCKET_DEBUG - Module.print('recvmsg loop ' + [i, num, bytes, currNum]); + Module.print('recvmsg loop ' + [i, num, bytes, currNum]); #endif if (!currNum) continue; currNum = Math.min(currNum, bytes); // XXX what should happen when we partially fill a buffer..? bytes -= currNum; var currBuf = {{{ makeGetValue('iov', '8*i', 'i8*') }}}; #if SOCKET_DEBUG - Module.print('recvmsg call recv ' + currNum); + Module.print('recvmsg call recv ' + currNum); #endif HEAPU8.set(buffer.subarray(bufferPos, bufferPos + currNum), currBuf); bufferPos += currNum; @@ -7785,7 +7785,7 @@ LibraryManager.library = { if (bufferPos < bytes) { info.inQueue.unshift(buffer.subarray(bufferPos)); #if SOCKET_DEBUG - Module.print('recvmsg: put back: ' + (bytes - bufferPos)); + Module.print('recvmsg: put back: ' + (bytes - bufferPos)); #endif } } |