微信https从传输流收到意外的 EOF 或 0 个字节

今天用webrequest请求微信https api获取token时出现错误。代码错误行(操作系统window7和window2003都会报错)

行 47: response = request.GetResponse() as HttpWebResponse;

从传输流收到意外的 EOF 或 0 个字节。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.IO.IOException: 从传输流收到意外的 EOF 或 0 个字节。

[IOException: 从传输流收到意外的 EOF 或 0 个字节。]
[WebException: 基础连接已经关闭: 发送时发生错误。]
   public static bool SecurityValidate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
    {
        return true;//直接确认,不然打不开,会出现超时错误
    }
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(SecurityValidate);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
//...
request.ProtocolVersion = HttpVersion.Version10;
//.....
response = request.GetResponse() as HttpWebResponse;

1个回答

波波@Ajax 2018/4/6 23:34:18
ssl3改为tls试试

//ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
//===>
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
收到0而不是预期的7个字节AMQPIOException - 用户是正确的,仅当队列为空时

<div class="post-text" itemprop="text"> <p>I use "php-amqplib/rabbitmq-bundle": "^1.14",</p> <p>console command</p> <pre><code> /app/console rabbitmq:consumer parse_ppmconsumer -m 100 </code></pre> <p>error is</p> <pre><code>Message: "Error reading data. Received 0 instead of expected 7 bytes" ["error" =&gt; PhpAmqpLib\Exception\AMQPIOException { …},"command" =&gt; "rabbitmq:consumer parse_ppmconsumer -m 100","message" =&gt; "Error reading data. Received 0 instead of expected 7 bytes"] [] </code></pre> <p>i found similar errors but they have error is permissions i check my: </p> <pre><code>sudo rabbitmqctl list_permissions -p / [sudo] password for grek: Listing permissions in vhost "/" ... guest .* .* .* root .* .* .* </code></pre> <p>so its correct</p> <p>situation is only when queue is empty , when i have some data i get </p> <p>/app/console rabbitmq:consumer parse_ppmconsumer -m 100 00:00,1792631149292 00:00,048967838287354 00:00,037322998046875 00:00,062886953353882 00:00,009692907333374 00:00,02227783203125 00:00,028231859207153 00:00,033851146697998 00:00,0090358257293701 00:00,01706600189209 00:00,012717962265015 00:00,020620107650757 00:00,01526403427124 00:00,016094207763672 00:00,016033887863159 00:00,014401912689209</p> <ul> <li>this is every message proccessing time.</li> </ul> <p>at the end i get : </p> <pre><code>00:00,078952074050903 00:00,12211585044861 00:00,3163890838623 00:00,5457661151886 18:53:27 ERROR [console] Error thrown while running command "rabbitmq:consumer parse_ppmconsumer -m 100". Message: "Error reading data. Received 0 instead of expected 62 bytes" ["error" =&gt; PhpAmqpLib\Exception\AMQPIOException { …},"command" =&gt; "rabbitmq:consumer parse_ppmconsumer -m 100","message" =&gt; "Error reading data. Received 0 instead of expected 62 bytes"] [] [PhpAmqpLib\Exception\AMQPIOException] Error reading data. Received 0 instead of expected 62 bytes </code></pre> <p>where is problem ?</p> </div>

Golang:读取Gzip Reader时出现意外的EOF错误

<div class="post-text" itemprop="text"> <p>I'm currently working on a project in which a client python script compresses the input by using gzip package, then, encrypts the compressed data according to <code>AES</code>, and, finally, it encodes the encrypted data in <code>base64</code> encoding scheme. On the server side, which was written in <code>golang</code> I'm following the same steps in the reverse order to reach the original data. </p> <p>As can be seen from the output, I can decode, decrypt and decompress the data received from the client on my test script. However, while reading the <code>gzip.NewReader</code> type it throws <code>unexpected EOF error</code>. <em>(see the output at the very bottom of the question)</em></p> <p>So far, I've done it without trimming the padding, however, then it gave me an <code>invalid gzip header error</code>. Then, just to verify if there are any significant differences between a valid <code>gzip Reader</code> and the one being created by the script, I gzipped the original data into a compressed form. Apparently, there were no notable differences I could see from outputs, but the differences in bytes which were most likely caused by the change in time that the readers are created:</p> <blockquote> <p>Original data: {"i": "MB88", "p": [{"d": [54.3, 0, 99, 49.35, 3, 99, 51.533, 1, 98, 28964, 7348, 43590, 97107, 10350, 55200, 49.7], "t": 1499089212.136789, "dt": "p"}]}</p> <p>Gzipped data: "\x1f\x8b\x08\x00\xf9w[Y\x02\xff%\x8e=\x0e\xc30\x08F\xaf\x82\x98\x91\x05\xe6\xc7\xa6c\xf7\x9e\xa0\xca\x96\xa5[\x86lQ\xee^\xdcN\xf0\xf4\xc1\x83\x0b?\xf8\x00|=\xe7D\x02&lt; \xde\x17\xee\xab\xb85%<code>\x82L\x02\xcb\xa6N\xa0\x7fri\xae\xd5K\xe1$\xe83\xc3\x08\x86Z\x81\xa9g-y\x88\xf6\x9a</code>\xf5E\xde\x99\x7f\x96\xb1\xd5\x99\xb3\xfcb\x99\x121D\x1bG\xe7^.\xdcWPO\xdc\xdb\xfd\x05\x0ev\x15\x1d\x99\x00\x00\x00"</p> <p>Gzip Reader created from the request by client</p> <p>GzReader: &amp;{{ [] 2017-07-03 15:40:12 +0200 CEST 255} 0xc42007e150 0xc4200a8000 0 0 [31 139 8 0 60 73 90 89 2 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] true}</p> <p>Gzip Reader created by directly reading the original data</p> <p>GzReader2: &amp;{{ [] 2017-07-04 13:11:53 +0200 CEST 255} 0xc4200741e0 0xc4200a9300 0 0 [31 139 8 0 249 119 91 89 2 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] true}</p> </blockquote> <p>Now, I'm quite curious about what might be causing this error and how this issue can be solved. I couldn't post the original scripts here due to some restrictions but these are the actual test scripts that I'm currently testing my code. I've tried to give as much as information I could think of at the moment, however, please feel free to ask me if you need any more explanation. I'd really appreciate if you can help me solve this!</p> <p>Cheers!</p> <p><strong>Client Code (Tester):</strong> </p> <pre><code>import time import json import requests import random import gzip import base64 from Crypto.Cipher import AES baseurl = 'http://0.0.0.0:80' key = b'TfvY7I358yospfWKcoviZizOShpm5hyH' iv = b'mb13KcoviZizvYhp' MODE = AES.MODE_CFB BLOCK_SIZE = 16 SEGMENT_SIZE = 128 def http_post(url, data): print('Going to make a request to {} with the following data: {}'.format(url, data)) r = requests.post(url, data=data, headers={'Content-type': 'application/json; charset=utf-8', 'Connection': 'keep-alive'}, ) if r.status_code != 200: print('Server returned unexpected response code {}, and content: {}'.format(r.status_code, r.content)) return False else: data = r.json() return data def post_sample_data(key, iv): fake_device_id = "MB88" Load_VA_Total_Mean = random.randint(1000, 100000) print('Data that should come back: {}'.format(Load_VA_Total_Mean)) data = {"i": fake_device_id, "p": [ {"d": [54.3, 0, 99, 49.35, 3, 99, 51.533, 1, 98, 28964, 7348, 43590, Load_VA_Total_Mean, 10350, 55200, 49.7], "t": time.time(), "dt": "p"}]} url = baseurl + '/realtimedata' encryption_key_reference = 1 payload = '{} {}'.format(convert_pack(data, key, iv), encryption_key_reference) return http_post(url, payload) def check_sample_request(): fake_device_id = "MB88" url = baseurl + '/datapoints/powerzones/status' data = [{"name": "P1", "field": "Load_VA_Total_Mean", "devices": [{"id": fake_device_id, "multiplier": 1}]}] return http_post(url, json.dumps(data)) def convert_pack(inputdict, key, iv): print('input: {}'.format(inputdict)) print('key: {}'.format(key)) jsonpayload = json.dumps(inputdict) # encode dict to json string print('json: {}'.format(jsonpayload)) gzippayload = gzip.compress(jsonpayload.encode('utf-8')) # compress with gzip print('gzip: {}'.format(gzippayload)) encryptedpayload = base64.b64encode(encrypt(key, iv, gzippayload)) print('encrypted: {}'.format(encryptedpayload)) return str(encryptedpayload, encoding='utf-8') def _pad_string(value): length = len(value) pad_size = BLOCK_SIZE - (length % BLOCK_SIZE) return value.ljust(length + pad_size, b'\x00') def encrypt(key, iv, plaintext): aes = AES.new(key, MODE, iv, segment_size=SEGMENT_SIZE) plaintext = _pad_string(plaintext) encrypted_text = aes.encrypt(plaintext) return encrypted_text post_sample_data(key, iv) check_sample_request() </code></pre> <p><strong>Server Code (Tester):</strong></p> <pre><code>package main import ( "crypto/aes" "crypto/cipher" "encoding/base64" "fmt" "compress/gzip" "io/ioutil" "bytes" "strings" ) func main() { //a sample input text generated by the client script originalText := "xhhpLqMJs4g8+8Hb751bcalljkeHDJfbGdMqr9E9im1OkiJzmdLr7pWv/Grh0+uzdeMQBMzefqzTrzetf1fZcBm93IEF6wl8WYE5x2uAZ5XY39bxlRWDt4cTNk/wWisbAMSzNJqQUq2UmqBLaWcI0LU1NGPZd8EKHK36Iwlp8NuP+YsQIJSmQdN2cvNFOLGv" fmt.Println("Original request: ", originalText) key := []byte("TfvY7I358yospfWKcoviZizOShpm5hyH") text := decrypt(key, originalText) gzReader, err1 := gzip.NewReader(bytes.NewReader(text)) fmt.Println("GzReader: ", gzReader) if err1 != nil { fmt.Println("error1: ", err1) } content, err2 := ioutil.ReadAll(gzReader) if err2 != nil { fmt.Println("error2: ",err2) } fmt.Printf(" Reading: -&gt; Content in bytes: %v -&gt; Content in string: %s ", content, string(content)) } func decrypt(key []byte, cryptoText string) []byte { ciphertext, _ := base64.StdEncoding.DecodeString(cryptoText) fmt.Printf(" Decoding: -&gt; Original: %v -&gt; Decoded in bytes: %v -&gt; Decoded in string: %s ", cryptoText, ciphertext, ciphertext) block, err := aes.NewCipher(key) if err != nil { panic(err) } iv := []byte("mb13KcoviZizvYhp") stream := cipher.NewCFBDecrypter(block, iv) stream.XORKeyStream(ciphertext, ciphertext) fmt.Printf(" Decrypting: -&gt; Decrypted in bytes: %v -&gt; Decrypted in string: %s ", ciphertext, ciphertext) ciphertext = bytes.Trim(ciphertext, "\x00") fmt.Printf(" Trimming the padding: -&gt; Decrypted in bytes: %v -&gt; Decrypted in string: %s ", ciphertext, ciphertext) return ciphertext } </code></pre> <p><strong>The output in terminal:</strong></p> <blockquote> <p>Original request: </p> <p>xhhpLqMJs4g8+8Hb751bcalljkeHDJfbGdMqr9E9im1OkiJzmdLr7pWv/Grh0+uzdeMQBMzefqzTrzetf1fZcBm93IEF6wl8WYE5x2uAZ5XY39bxlRWDt4cTNk/wWisbAMSzNJqQUq2UmqBLaWcI0LU1NGPZd8EKHK36Iwlp8NuP+YsQIJSmQdN2cvNFOLGv</p> <p>Decoding: </p> <p>-&gt; Original: xhhpLqMJs4g8+8Hb751bcalljkeHDJfbGdMqr9E9im1OkiJzmdLr7pWv/Grh0+uzdeMQBMzefqzTrzetf1fZcBm93IEF6wl8WYE5x2uAZ5XY39bxlRWDt4cTNk/wWisbAMSzNJqQUq2UmqBLaWcI0LU1NGPZd8EKHK36Iwlp8NuP+YsQIJSmQdN2cvNFOLGv </p> <p>-&gt; Decoded in bytes: [198 24 105 46 163 9 179 136 60 251 193 219 239 157 91 113 169 101 142 71 135 12 151 219 25 211 42 175 209 61 138 109 78 146 34 115 153 210 235 238 149 175 252 106 225 211 235 179 117 227 16 4 204 222 126 172 211 175 55 173 127 87 217 112 25 189 220 129 5 235 9 124 89 129 57 199 107 128 103 149 216 223 214 241 149 21 131 183 135 19 54 79 240 90 43 27 0 196 179 52 154 144 82 173 148 154 160 75 105 103 8 208 181 53 52 99 217 119 193 10 28 173 250 35 9 105 240 219 143 249 139 16 32 148 166 65 211 118 114 243 69 56 177 175] </p> <p>-&gt; Decoded in string: �i.� ��&lt;����[q�e�G� ���*��=�mN�"s����j���u���~�ӯ7�W�p�܁� |Y�9�k�g��������6O�Z+ij4��R����Kiе54c�w� ��# i�ۏ�� ��A�vr�E8��</p> <p>Decrypting: </p> <p>-&gt; Decrypted in bytes: [31 139 8 0 60 73 90 89 2 255 37 142 49 14 2 65 8 69 175 66 168 201 4 6 88 192 210 222 19 152 237 182 177 179 176 219 236 221 101 180 130 151 15 15 78 124 225 13 240 113 207 68 2 124 55 60 79 60 86 113 27 74 192 4 85 4 86 67 157 64 255 228 50 92 187 151 198 36 152 89 155 17 132 90 131 169 215 90 10 225 232 9 86 111 114 159 204 63 75 236 125 230 211 126 177 42 206 154 50 135 232 22 217 90 60 86 208 79 92 251 245 5 234 198 128 61 153 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] �q�D|7 </p><p>Trimming the padding: </p> <p>-&gt; Decrypted in bytes: [31 139 8 0 60 73 90 89 2 255 37 142 49 14 2 65 8 69 175 66 168 201 4 6 88 192 210 222 19 152 237 182 177 179 176 219 236 221 101 180 130 151 15 15 78 124 225 13 240 113 207 68 2 124 55 60 79 60 86 113 27 74 192 4 85 4 86 67 157 64 255 228 50 92 187 151 198 36 152 89 155 17 132 90 131 169 215 90 10 225 232 9 86 111 114 159 204 63 75 236 125 230 211 126 177 42 206 154 50 135 232 22 217 90 60 86 208 79 92 251 245 5 234 198 128 61 153] �q�D|7 </p><p>GzReader: &amp;{{ [] 2017-07-03 15:40:12 +0200 CEST 255} 0xc42007e150 0xc4200a8000 0 0 [31 139 8 0 60 73 90 89 2 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] true}</p> <p>error2: unexpected EOF</p> <p>Reading:</p> <p>-&gt; Content in bytes: [123 34 105 34 58 32 34 77 66 56 56 34 44 32 34 112 34 58 32 91 123 34 100 34 58 32 91 53 52 46 51 44 32 48 44 32 57 57 44 32 52 57 46 51 53 44 32 51 44 32 57 57 44 32 53 49 46 53 51 51 44 32 49 44 32 57 56 44 32 50 56 57 54 52 44 32 55 51 52 56 44 32 52 51 53 57 48 44 32 57 55 49 48 55 44 32 49 48 51 53 48 44 32 53 53 50 48 48 44 32 52 57 46 55 93 44 32 34 116 34 58 32 49 52 57 57 48 56 57 50 49 50 46 49 51 54 55 56 57 44 32 34 100 116 34 58 32 34 112 34 125 93 125] </p> <p>-&gt; Content in string: {"i": "MB88", "p": [{"d": [54.3, 0, 99, 49.35, 3, 99, 51.533, 1, 98, 28964, 7348, 43590, 97107, 10350, 55200, 49.7], "t": 1499089212.136789, "dt": "p"}]}</p> </blockquote> </div>

精确读取n个字节,除非EOF?

<div class="post-text" itemprop="text"> <p>I'm using a function that returns an <code>io.Reader</code> to download a file from the Internet.</p> <p>I want to process the file in exactly 2048 chunks until it's no longer possible because of EOF.</p> <p>The <code>io.ReadFull</code> function is almost what I want:</p> <pre><code>buf := make([]byte, 2048) for { if _, err := io.ReadFull(reader, buf); err == io.EOF { return io.ErrUnexpectedEOF } else if err != nil { return err } // Do processing on buf } </code></pre> <p>The problem with this is that not all files are a multiple of 2048 bytes, so the last chunk may only be e.g. 500 bytes, <code>io.ReadFull</code> will therefore return <code>ErrUnexpectedEOF</code> and the last chunk is discarded.</p> <p>A function name to summarize what I want could be <strong>io.ReadFullUnlessLastChunk</strong>, so <code>ErrUnexpectedEOF</code> is not returned if the reason that <code>buf</code> cannot be filled with 2048 bytes, is that the file is EOF after e.g. 500 bytes. However, in any other case <code>ErrUnexpectedEOF</code> should be returned as a problem has occured.</p> <p>What could I do to accomplish this?</p> <p>Another problem is that reading only 2048 bytes at the time directly from the network seems to have much overhead, if I could get 256 KB from network into a buffer, and then take the 2048 bytes I need from that buffer instead, that would be better.</p> </div>

转:从套接字读取时发生意外的EOF

<div class="post-text" itemprop="text"> <p>I have the following simple golang program to download Google's privacy policy. Unfortunately it always crashes with the error <code>unexpected EOF</code> after reading 6861 bytes, even though the document is much longer. Why?</p> <pre><code>package main import "net" import "fmt" import "io" import "os" func die(msg string, s os.Error) { fmt.Printf("%s crashed: %v ", msg, s) os.Exit(1) } func main() { fd, err := net.Dial("tcp", "google.com:80") if err != nil { die("dial", err) } req := []byte("GET /intl/en/privacy/ HTTP/1.0 Host: www.google.com ") _, err = fd.Write(req) if err != nil { die("dial write", err) } buf := make([]byte, 1024) nr := 1 for nr &gt; 0 { nr, err = io.ReadFull(fd, buf) if err != nil { die("dial read", err) } fmt.Printf("read %d ", nr) } } </code></pre> <p>outputs:</p> <pre><code>read 1024 read 1024 read 1024 read 1024 read 1024 read 1024 dial read crashed: unexpected EOF </code></pre> </div>

发送POST请求时出现意外的EOF

<div class="post-text" itemprop="text"> <p>I'm having some trouble sending a simple POST request with the http package:</p> <pre><code>var http_client http.Client req, err := http.NewRequest("POST", "http://login.blah", nil) if err != nil { return errors.New("Error creating login request: " + err.Error()) } req.Header.Add("Content-Type", "application/x-www-form-urlencoded") body := fmt.Sprintf("?username=%s&amp;password=%s&amp;version=%d", client.Username, client.Password, launcherVersion) fmt.Println("Body:", body) req.Body = ioutil.NopCloser(bytes.NewBufferString(body)) req.ParseForm() resp, err := http_client.Do(req) if err != nil { return errors.New("Error sending login request: " + err.Error()) } </code></pre> <p>I see the correct body from the print:</p> <pre><code>Body: ?username=test&amp;password=test&amp;version=13 </code></pre> <p>But after 60 seconds, I get:</p> <pre><code>Error sending login request: unexpected EOF </code></pre> <p>I'm sure it has something to do with how I set the request body, because watching it with Wireshark shows me the request, which goes out right away, has a <code>Content-Length</code> of 0 with no body.</p> <pre><code>POST / HTTP/1.1 Host: login.blah User-Agent: Go http package Content-Length: 0 Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip </code></pre> </div>

pgbouncer错误:关闭原因:客户意外eof(年龄= 0)

<div class="post-text" itemprop="text"> <p>My project is written with golang,I use postgresql Database and use pgbouncer as a database pool connection. I did a pressure test after I finished the basic function.</p> <p>It runs well as test by the command(just 1 concurrency):</p> <pre><code>ab -n 1000 -c 1 -p '/home/mwh/postfile.txt' -T 'application/x-www-form-urlencoded' 'http://192.168.1.229:8090/hwSdk/tsk/get_t_k.json' </code></pre> <p>But when I increase the concurrency:</p> <pre><code>ab -n 10000 -c 100 -p '/home/mwh/postfile.txt1 -T 'application/x-www-form-urlencoded' 'http://192.168.1.229:8090/hwSdk/tsk/get_t_k.json' </code></pre> <p>something happened error with database query in the app log:</p> <pre><code>[2017-06-01 12:04:00] (pq: bind message supplies 18 parameters, but prepared statement "" requires6) [2017-06-01 12:04:00] (pq: bind message supplies 19 parameters, but prepared statement "" requires 3) </code></pre> <p>In the pgbouncer.log file</p> <pre><code>8035 2017-06-01 12:04:01.702 45619 LOG C-0xf9a4c0: cygnus/cygnus@192.168.1.229:40397 closing because: client close request (age=0) 8036 2017-06-01 12:04:01.703 45619 LOG C-0xf8b9f0: cygnus/cygnus@192.168.1.229:40406 closing because: client close request (age=0) 8037 2017-06-01 12:04:01.703 45619 LOG C-0xf8b248: cygnus/cygnus@192.168.1.229:40574 login attempt: db=cygnus user=cygnus tls=no 8038 2017-06-01 12:04:01.703 45619 LOG C-0xf8c198: cygnus/cygnus@192.168.1.229:40468 closing because: client close request (age=0 8039 2017-06-01 12:04:01.703 45619 LOG C-0xfac6f0: cygnus/cygnus@192.168.1.229:40504 closing because: client close request (age=0) 8040 2017-06-01 12:04:01.707 45619 LOG C-0xf9e698: cygnus/cygnus@192.168.1.229:40235 closing because: client unexpected eof (age=0) </code></pre> <p>my pgbouncer.ini settings:</p> <pre><code>pool_mode = Transaction listen_port = 6543 listen_addr = * auth_type = md5 auth_file = /etc/pgbouncer/userlist.txt logfile = /tmp/pgbouncer.log pidfile = /tmp/pgbouncer.pid stats_users = readonly,cygnus max_client_conn = 2000 default_pool_size = 400 ignore_startup_parameters = extra_float_digits </code></pre> <p>what's the problem?</p> </div>

带有嵌套模板的Golang意外EOF

<div class="post-text" itemprop="text"> <p>I am trying to display the contents of a slice on a page. Displaying the templates with static text works. As soon as I try and range over the slice sent to <code>ExTpl()</code>, I get an EOF error.</p> <pre><code>type Miner struct { IP string `bson:"ip"` Port int32 `bson:"port"` FailCount int `bson:"failcount"` } type ( MinerController struct { Session *mgo.Session } ) func ExTpl(w http.ResponseWriter, data []Miner) { t, _ := template.ParseFiles("templates/header.tmpl", "templates/footer.tmpl", "templates/data.tmpl") t.ExecuteTemplate(w, "data", data) } func FilterMiners(c *mgo.Collection, key, value string, limit int) ([]Miner, int, error) { var results []Miner query := bson.M{key: value} if len(key) == 0 { query = nil } err := c.Find(query).Limit(limit).All(&amp;results) if err != nil { return results, 0,errors.New("error retrieving hosts") } return results, len(results), nil } func (mc MinerController) GetSpecificMiners(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) l, err := strconv.Atoi(vars["limit"]) if err != nil { l = 0 } collection := Collection("miners", "NASty", mc.Session) fleet, _ , _ := FilterMiners(collection, vars["key"], vars["value"], l) ExTpl(w, fleet) } </code></pre> <p>Here are the templates in question:</p> <p><strong>header.tmpl</strong></p> <pre><code>{{define "header"}} &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"&gt; &lt;/head&gt; &lt;body&gt; {{end}} </code></pre> <p><strong>data.tmpl</strong></p> <pre><code>{{define "data"}} {{template "header"}} {{range .}} {{.IP}} {{template "footer"}} {{end}} </code></pre> <p><strong>footer.tmpl</strong></p> <pre><code>{{define "footer"}} &lt;/body&gt; &lt;/html&gt; {{end}} </code></pre> <p>When I run this, I get the following error:</p> <pre><code>2017/10/27 12:24:56 http: panic serving [::1]:50252: template: data.tmpl:6: unexpected EOF goroutine 49 [running]: net/http.(*conn).serve.func1(0xc042138000) C:/Go/src/net/http/server.go:1721 +0xd7 panic(0x7abbc0, 0xc042170360) C:/Go/src/runtime/panic.go:489 +0x2dd git.REDACTED.duckdns.org/REDACTED/RESTingMongo/controllers.ExTpl(0x9b7820, 0xc04211c460, 0xc042172000, 0x2, 0x2) D:/_projects/Go/src/git.REDACTED.duckdns.org/REDACTED/RESTingMongo/controllers/handlers.go:25 +0x84 git.REDACTED.duckdns.org/REDACTED/RESTingMongo/controllers.MinerController.GetSpecificMiners(0xc04203b040, 0x9b7820, 0xc04211c460, 0xc0420f6600) D:/_projects/Go/src/git.REDACTED.duckdns.org/REDACTED/RESTingMongo/controllers/miners.go:74 +0x2b9 git.REDACTED.duckdns.org/REDACTED/RESTingMongo/controllers.(MinerController).GetSpecificMiners-fm(0x9b7820, 0xc04211c460, 0xc0420f6600) D:/_projects/Go/src/git.REDACTED.duckdns.org/REDACTED/RESTingMongo/routes/routes.go:33 +0x55 net/http.HandlerFunc.ServeHTTP(0xc04203f210, 0x9b7820, 0xc04211c460, 0xc0420f6600) C:/Go/src/net/http/server.go:1942 +0x4b git.REDACTED.duckdns.org/REDACTED/RESTingMongo/routes.Logger.func1(0x9b7820, 0xc04211c460, 0xc0420f6600) D:/_projects/Go/src/git.REDACTED.duckdns.org/REDACTED/RESTingMongo/routes/handlers.go:12 +0x18d net/http.HandlerFunc.ServeHTTP(0xc0420467c0, 0x9b7820, 0xc04211c460, 0xc0420f6600) C:/Go/src/net/http/server.go:1942 +0x4b github.com/gorilla/mux.(*Router).ServeHTTP(0xc04203c420, 0x9b7820, 0xc04211c460, 0xc0420f6600) D:/_projects/Go/src/github.com/gorilla/mux/mux.go:133 +0x108 net/http.serverHandler.ServeHTTP(0xc04208e2c0, 0x9b7820, 0xc04211c460, 0xc042116100) C:/Go/src/net/http/server.go:2568 +0x99 net/http.(*conn).serve(0xc042138000, 0x9b7fe0, 0xc042104280) C:/Go/src/net/http/server.go:1825 +0x619 created by net/http.(*Server).Serve C:/Go/src/net/http/server.go:2668 +0x2d5 </code></pre> <p>I am not sure what is going on, since all of my templates have the correct format, and the <code>Miner</code> struct contains an <code>IP</code> field, which I should be able to access in the range loop with <code>.IP</code>.</p> </div>

出错:Golang意外的EOF

<div class="post-text" itemprop="text"> <p>这是我的代码,我是Go新手。我试着在谷歌上搜索这个问题,但我不能完全理解它,我认为这与read()方法有关。</p> <pre><code>package main import ( ... ) type compressor struct { content []byte } func (r *compressor) compress() []byte { ... } func (r *compressor) decompress() []byte { var buffer bytes.Buffer dc := flate.NewReader(&amp;buffer) _, err := dc.Read(r.content) if err != nil { if err != io.EOF { log.Fatal(err) } } return buffer.Bytes() } func main() { fileName := os.Args[1] fmt.Println(os.Args) contents, err := ioutil.ReadFile(fileName) if err != nil { log.Fatal(err) } fmt.Print("Uncompressed data: ") fmt.Println(len(contents)) comp := compressor{contents} buffer := comp.decompress() fmt.Print("Uncompressed data: ") fmt.Println(len(comp.decompress())) err = ioutil.WriteFile(fileName+".decjc", buffer, 0644) if err != nil { log.Fatal(err) } } </code></pre> <p>输出如下:</p> <p>dylan@skynet:~/Documents/EXP/jc$ ./jc data.txt.jc </p> <p>[./jc data.txt.jc]</p> <p>Uncompressed data: 2364480</p> <p>2018/06/29 21:41:35 unexpected EOF</p> </div>

收到EOF紧急错误

<div class="post-text" itemprop="text"> <p>I'm trying to decode a json I get. Here's an example json I get: </p> <pre><code>{"response":"1","number":"1234","id":nil} </code></pre> <p>Here's my struct: </p> <pre><code>type AutoGenerated struct { Response string `json:"response"` Number string `json:"number"` ID interface{} `json:"id"` } </code></pre> <p>I use the decode function in encode/json. What Am I getting wrong? ID has the chance to be both a string or a nil value.</p> <p>Here's me exact error incase it helps.</p> <pre><code>panic: EOF </code></pre> </div>

读取多部分请求会导致意外的EOF错误

<div class="post-text" itemprop="text"> <p>Go version: 1.6.3 macos</p> <p>I am trying to write an api to upload an apk file (several MB in most cases) to the server. Here is the client side code:</p> <pre><code>func syncApk(apkFile *os.File) { defer apkFile.Close() var buffer bytes.Buffer writer := multipart.NewWriter(&amp;buffer) defer writer.Close() part, err := writer.CreateFormFile("apk", filepath.Base(apkFile.Name())) if err != nil { fmt.Fprintf(os.Stderr, "Error creating form file: %v ", err) return } size, err := io.Copy(part, apkFile) if err != nil { fmt.Fprintf(os.Stderr, "Error copying apk file data: %v ", err) return } fmt.Fprintf(os.Stdout, "Copied %v bytes for uploading... ", size) response, err := http.Post("http://localhost:8080/upload", writer.FormDataContentType(), &amp;buffer) if err != nil { fmt.Fprintf(os.Stderr, "Error making POST request to sync apk: %v ", err) return } fmt.Fprintf(os.Stdout, "Successfully uploaded apk file: %v ", response.StatusCode) } </code></pre> <p>Server code:</p> <pre><code>func main() { server := http.Server{ Addr: ":8080", } http.HandleFunc("/upload", doApkUpload) server.ListenAndServe() } func doApkUpload(w http.ResponseWriter, r *http.Request) { file, _, err := r.FormFile("apk") if err != nil { fmt.Fprintf(os.Stderr, "Error retrieving apk file: %v ", err) return } data, err := ioutil.ReadAll(file) if err != nil { fmt.Fprintf(os.Stderr, "Error reading apk file content: %v", err) return } fmt.Fprintf(os.Stdout, string(data)) } </code></pre> <p>After I run the server on localhost I run client side code, I get:</p> <pre><code>Copied 1448401 bytes for uploading... Successfully uploaded apk file: 200 </code></pre> <p>It looks like the multipart file is written correctly. However I see this error on the server side:</p> <pre><code>Error retrieving apk file: unexpected EOF </code></pre> <p>Any idea where is the problem? Thanks!</p> </div>

为什么从此API调用中得到意外的EOF?

<div class="post-text" itemprop="text"> <p>I have the following Go code which I am running as an AWS Lambda cron, but I am unsure why I get this error:</p> <pre><code>sls logs --stage prod --region eu-west-1 --function esCronFn 2018/12/12 12:07:01 unexpected EOF 2018/12/12 12:07:01 unexpected EOF END RequestId: 6bf33d28-fe03-11e8-949d-f39174c57cab REPORT RequestId: 6bf33d28-fe03-11e8-949d-f39174c57cab Duration: 464734.47 ms Billed Duration: 464800 ms Memory Size: 256 MB Max Memory Used: 257 MB RequestId: 6bf33d28-fe03-11e8-949d-f39174c57cab Process exited before completing request </code></pre> <p>this is my main.go - it basically connects to an external API and pulls records which I am processing and uploading to an S3 bucket.</p> <p>package main</p> <pre><code>import ( "bytes" "encoding/csv" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/url" "os" "strings" "time" "github.com/aws/aws-lambda-go/lambda" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3iface" ) var ( // ENDPOINT is the endpoint from which incomplete CSV records are downloaded ENDPOINT = os.Getenv("ENDPOINT") PARSED_ENDPOINT *url.URL // TOKEN authenticates requests sent to eshot API TOKEN = os.Getenv("TOKEN") // BUCKET is the S3 bucket to which CSV files are uploaded BUCKET = os.Getenv("BUCKET") svc s3iface.S3API ) // Record is the JSON response returned by a successful request to API type EsRecord struct { Salutation string `json:"Salutation"` Firstname string `json:"Firstname"` Lastname string `json:"Lastname"` Company string `json:"Company"` EEA string `json:"EEA"` ModifiedDate time.Time `json:"ModifiedDate"` SubaccountID string `json:"SubaccountId"` Email string `json:"Email"` } // CsvData holds reference to underlying buffer and the csv writer type CsvData struct { Buffer *bytes.Buffer Writer *csv.Writer } func init() { today := time.Now() // If ENDPOINT is empty, It'll use this hardcoded endpoint. The ENDPOINT variable should not contain any text after "ModifiedDate gt". The actual date is currentDay-1 if ENDPOINT == "" { ENDPOINT = "https://rest-api.domain.tld/Export/?$select=Email,Firstname,Lastname,SubaccountId,EEA,ModifiedDate&amp;$filter=(EEA eq '' or EEA eq null) and ModifiedDate gt" } // Append CurrentDay-1 in YYYY-MM-DDTHH:MM:SSZ format. // The time is NOT in UTC. It's the local time of the machine on which lambda function was running ENDPOINT = fmt.Sprintf("%s %sT00:00:00Z", ENDPOINT, today.AddDate(0, 0, -1).Format("2006-01-02")) var err error PARSED_ENDPOINT, err = url.Parse(ENDPOINT) if err != nil { log.Fatalln("Invalid $ENDPOINT", err) } PARSED_ENDPOINT.RawQuery = QueryEscape(PARSED_ENDPOINT.RawQuery) } func main() { if TOKEN == "" { log.Fatalln("$TOKEN is empty") } if BUCKET == "" { log.Fatalln("$BUCKET is empty") } // Create S3 session svc = s3iface.S3API(s3.New(session.Must(session.NewSession()))) lambda.Start(CreateAndUploadCsvToS3) } func CreateAndUploadCsvToS3() error { resp, err := fetchRecords() if err != nil { return fmt.Errorf("error in fetching records: %s", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { b, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf("api returned non 200 response(%d), URL: %s, %s", resp.StatusCode, PARSED_ENDPOINT.String(), string(b)) } // API returns array of EshotRecord esRecords := []EsRecord{} err = json.NewDecoder(resp.Body).Decode(&amp;esRecords) if err != nil { b, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf("error in parsing response %s: %s", err, string(b)) } recordsMap := ParseEsRecordsJSON(esRecords) ct := time.Now().String() for k, v := range recordsMap { key := fmt.Sprintf("%s_%s.csv", k, ct) _, err := svc.PutObject(&amp;s3.PutObjectInput{ Bucket: aws.String(BUCKET), // Key is in format, &lt;subaccountid&gt;_&lt;current timestamp&gt;.csv Key: aws.String(key), Body: bytes.NewReader(v.Buffer.Bytes()), }) if err != nil { return fmt.Errorf("error in uploading %s: %s", key, err) } } return nil } // ParseEsRecordsJSON takes an array of EsRecord // Seperates each record by subAccountId // Creates CSV files for each SubAccountId // Returns the hashmap func ParseEsRecordsJSON(esRecords []EsRecord) map[string]CsvData { recordsMap := make(map[string]CsvData) for _, v := range esRecords { // If v.SubaccountID was encountered for the first time // 1. Create a Buffer // 2. Write CSV headers to this buffer // 3. Store reference to this buffer and csv writer in hashmap if _, ok := recordsMap[v.SubaccountID]; !ok { var buf bytes.Buffer writer := csv.NewWriter(&amp;buf) // Write CSV headers err := writer.Write([]string{"Firstname", "Lastname", "Email"}) if err != nil { log.Printf("error occurred in inserting headers for subAccountId(%s): %s ", v.SubaccountID, err) } // store reference to writer object for this subaccountid in hashmap recordsMap[v.SubaccountID] = CsvData{ Buffer: &amp;buf, Writer: writer, } } csvRef := recordsMap[v.SubaccountID] err := csvRef.Writer.Write([]string{v.Firstname, v.Lastname, v.Email}) if err != nil { log.Printf("error occurred in inserting headers for subAccountId(%s): %s ", v.SubaccountID, err) } csvRef.Writer.Flush() } return recordsMap } // FetchRecords makes a request to API and returns http.Response func fetchRecords() (*http.Response, error) { req, err := http.NewRequest("GET", PARSED_ENDPOINT.String(), nil) if err != nil { return nil, err } req.Header.Set("Authorization", fmt.Sprintf("Token %s", TOKEN)) client := &amp;http.Client{} return client.Do(req) } // QueryEscape replaces URL unsafe characters as listed in HTTP RFC with their HEX values. // The QueryEscape function in Go strictly adheres to the RFC and replaces all the characters listed in RFC with their HEX values. // Curl/Postman only encodes parameters on a strict "need" only bases. Presumably, the endpoint does not seems to be working with Go's encoded string. // This code escapes all the charactes and then performs uses string replace to make the URL more like what CURL would have done. func QueryEscape(s string) string { s = url.QueryEscape(s) s = strings.Replace(s, "%2C", ",", -1) s = strings.Replace(s, "%24", "$", -1) s = strings.Replace(s, "%3D", "=", -1) s = strings.Replace(s, "+", "%20", -1) s = strings.Replace(s, "%26", "&amp;", -1) s = strings.Replace(s, "%3A", ":", -1) return s } </code></pre> <p>If I change the <code>ENDPOINT</code> from:</p> <pre><code>ENDPOINT = "https://rest-api.domain.tld/Export/?$select=Email,Firstname,Lastname,SubaccountId,EEA,ModifiedDate&amp;$filter=(EEA eq '' or EEA eq null) and ModifiedDate gt" </code></pre> <p>to</p> <pre><code>ENDPOINT = "https://rest-api.domain.tld/Export/?$select=Email,Firstname,Lastname,SubaccountId,EEA,ModifiedDate&amp;$filter=EEA eq '' and ModifiedDate gt" </code></pre> <p>I don't get the <code>EOF</code> error, but then I don't get the full list, running curl, I get the data I need, so I am unsure why my code is failing and how best to track where it is failing?</p> </div>

使用SSL进入MySQL-意外的EOF

<div class="post-text" itemprop="text"> <p>I'm using the <a href="https://github.com/go-sql-driver/mysql" rel="nofollow noreferrer">Go MySQL driver</a> as part of a project. Recently, there was a need to enable SSL on the MySQL database I am connecting to. I have two servers that are configured with <code>TLSv1.1</code>. On one server, I am able connect successfully, but on the other I am getting <code>unexpected EOF</code> from the library.</p> <p>I tried setting <code>MaxIdleConnections</code> to 0 as described in <a href="https://stackoverflow.com/questions/39980902/golang-mysql-error-packets-go33-unexpected-eof">Golang MySQL error - packets.go:33: unexpected EOF</a>, but no luck. Prior to enabling SSL, connections to the server were working. There are other apps not written in Go that are able to connect successfully using the same credentials.</p> <p>When my app runs, the ping command fails immediately. The MySQL server logs are saying <code>bad handshake</code>. Is there something off with my connection code below, or is there a database setting that could be refusing to connect with <code>skip-verify</code>?</p> <pre><code>import ( "database/sql" "io/ioutil" "strings" "text/template" log "github.com/sirupsen/logrus" // Import runtime for MySQL mysql "github.com/go-sql-driver/mysql" ) type DatabaseConnection struct { Hostname string Port int Database string Username string Password string } func CreateSSLConnection(db *DatabaseConnection) (*sql.DB, error) { templateString := `{{.Username}}:{{.Password}}@{{.Hostname}}:{{.Port}}/{{.Database}}?tls=skip-verify` conn, err := connectToDatabase("mysql", templateString, db) // error: "unexpected EOF" err = conn.Ping() return conn, err } func connectToDatabase(databaseType string, connectionTemplateString string, db *DatabaseConnection) (*sql.DB, error) { connectionTemplate := template.Must(template.New("connectionString").Parse(connectionTemplateString)) builder := strings.Builder{} err := connectionTemplate.Execute(&amp;builder, db) if err != nil { log.WithFields(log.Fields{ "template": connectionTemplateString, "error": err, }).Error("Failed to create connection string") return nil, err } return sql.Open(databaseType, builder.String()) } </code></pre> </div>

在大猩猩网络套接字中获得``意外的EOF''

<div class="post-text" itemprop="text"> <p>I have the following read pump for a gorilla websockets connection in Go.</p> <pre><code>func (c *connection) readPump() { //function to close the websocket defer func() { socketsHub.unregister &lt;- c c.ws.Close() }() c.ws.SetReadLimit(maxMessageSize) c.ws.SetReadDeadline(time.Now().Add(pongWait)) c.ws.SetPongHandler(func(string) error { c.ws.SetReadDeadline(time.Now().Add(pongWait)) return nil }) for { //create a new socketMessage message := socketMessage{} //get the json message from the socket err := c.ws.ReadJSON(message) if err != nil { log.Println(err) break } //add the connection to the message message.Connection = c shouldBroadcast := message.Process() //if the new message should be broadcasted to any user (includeing the //one who sent it) if shouldBroadcast { socketsHub.broadcast &lt;- message } } </code></pre> <p>}</p> <p>This is the code we are using on the frontend:</p> <pre><code>if (window["WebSocket"]) { conn = new WebSocket("wss://localhost/api/ws") conn.onclose = function(evt) { console.log($("&lt;div&gt;&lt;b&gt;Connection closed.&lt;/b&gt;&lt;/div&gt;")) } } else { console.log($("&lt;div&gt;&lt;b&gt;Your browser does not support WebSockets.&lt;/b&gt;&lt;/div&gt;")) } </code></pre> <p>Everytime I load any page I get an <code>'websocket: close 1005'</code> error. I am about to go crazy. Any help would be great.</p> </div>

在Go中发送多个请求时出现零星的EOF错误

<div class="post-text" itemprop="text"> <p>Let me start by saying I'm new to Go and welcome any pointers/corrections.</p> <p>I'm trying to write a small Go application which will create a number of DNS queries and send them out in respective Go routines. I get the URLs from a file of 1000 URLs and create a slice, for each URL in the slice I make a query for the A record and push the URL and elapsed time to a result channel if successful and if there is an error to a respective error channel. I then listen on a select.</p> <p>What I'm struggling with is I will receive (seemingly randomly) an EOF error for some of my queries when using TCP and will receive i/o timeout error when using UDP. I would like to use TCP and ensure a response, I'm lost as to why I would be getting an EOF error. This also happens if I make 1000 queries to the same URL vs 1000 different URLs</p> <p>Working on OSX and Go version 1.6</p> <p>This is what I have so far:</p> <pre><code>package main import ( "bufio" "fmt" "github.com/miekg/dns" "os" "time" ) // CHECK AND PRINT ERRORS func checkErr(e error) { if e != nil { fmt.Println("Error: %s", e) } } // MAKES A SLICE OF URLS FROM TXT FILE func urlSlice() []string { result := []string{} file, err := os.Open("topsites.txt") checkErr(err) defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { result = append(result, scanner.Text()) } return result } func makeQuery(target string) (string, error) { server := "8.8.8.8" // WILL RECIEVE EOF ERROR IF TCP - I/O TIMEOUT IF UDP c := dns.Client{Net: "tcp", Timeout: time.Duration(100 * time.Second)} m := dns.Msg{} m.SetQuestion(dns.Fqdn(target+"."), dns.TypeA) _, t, err := c.Exchange(&amp;m, server+":53") if err != nil { return "", err } return "Url: " + target + " - - Took: " + t.String(), nil } func main() { start := time.Now() targets := urlSlice() resch, errch := make(chan string), make(chan error) for _, url := range targets { go func(url string) { res, err := makeQuery(url) if err != nil { errch &lt;- err return } resch &lt;- res }(url) } for i := 0; i &lt; len(targets); i++ { select { case res := &lt;-resch: fmt.Println(res) case err := &lt;-errch: fmt.Println(err) } } elapsed := time.Since(start) fmt.Println(" total time elapsed: ", elapsed) } </code></pre> <p>Output:</p> <pre><code>Url: facebook.com - - Took: 548.582107ms Url: wordpress.com - - Took: 548.805505ms Url: google.com.br - - Took: 541.491363ms Url: onclickads.net - - Took: 548.16544ms Url: bongacams.com - - Took: 543.28688ms Url: tianya.cn - - Took: 543.41525ms Url: blogger.com - - Took: 544.461005ms Url: alibaba.com - - Took: 543.53541ms Url: gmw.cn - - Took: 543.56093ms Url: pornhub.com - - Took: 664.297282ms Url: outbrain.com - - Took: 664.423217ms Url: ask.com - - Took: 671.557037ms EOF EOF EOF EOF EOF EOF EOF Url: t.co - - Took: 1.166130918s Url: youth.cn - - Took: 1.946658912s Url: apple.com - - Took: 2.763568935s ...continued... total time elapsed: 23.703546858s </code></pre> <p>Thoughts, suggestions, and help all appreciated. Thanks!</p> </div>

scanner中怎么才能输入EOF,不是三个字母,而是EOF这个特殊的字符,Java语言

scanner中怎么才能输入EOF,不是三个字母,而是EOF这个特殊的字符,Java语言 scanner中怎么才能输入EOF,不是三个字母,而是EOF这个特殊的字符,Java语言

去1.11.2 xml意外的EOF

<div class="post-text" itemprop="text"> <p>I want to check if an submitted xml file is a valid xml or not so I check if it can be parsed. I do it like that:</p> <pre><code>const EmptyXml = `&lt;?xml xmlns="http://www.w3.org/1999/xhtml"?&gt;` func CanParse(xmlData string) (bool, error) { if strings.TrimSpace(xmlData) == "" { return false, nil } type Tag struct { XMLName xml.Name Content string `xml:",innerxml"` } type Object struct { Items []Tag `xml:",any"` } var o *Object err := xml.Unmarshal([]byte(xmlData), &amp;o) if err != nil { return false, err } else { return true, nil } } </code></pre> <p>Sadly I end up with an error: unexpected EOF. Why is this?</p> <p>Actually the method did work a month ago, and golang has not been updated since then so I´m still about to figure out what broke the method</p> <p><a href="https://goplay.space/#YxiyTbq8ww0" rel="nofollow noreferrer">https://goplay.space/#YxiyTbq8ww0</a></p> </div>

一个困惑:EOF与feof()怎么用

``` #include <stdio.h> #include <stdlib.h> #define SIZE 50 #define FILENAME "E:\\1.txt" //---->内容: 12345 int main(void) { int ln; FILE *fp; char ar[SIZE]; ln = 0; if( (fp = fopen(FILENAME, "r") ) == NULL) { printf("Can not open file: %s\n", FILENAME); exit(1); } while( !feof(fp) ) { fgets(ar, SIZE, fp); // if( feof(fp) ) // { 这里注释掉就会把 12345 输出2遍, // break; // } printf("%s", ar); } fclose(fp); return 0; } ``` 我还是不明白EOF是和feof是怎么工作的,请教大家了。

awk脚本处理文本遇见→符号,二进制为0x1a,当做EOF的问题

111 222 333 444 555 666→ 777 888 999 BEGIN{IGNORECASE = 1; FS = " "; RS = "\n"} { print "第"NR"条记录共"NF"个字段",$0 } 上面→ 二进制代码为0x1a,被awk当成EOF处理,随意结果是 第1条记录共3个字段 111 222 333 第2条记录共3个字段 444 555 666 第三行读不出来,因为遇见那个箭头符号,然后当成EOF,之后都不处理了。 该怎么解决这个问题,让代码能忽视掉那个箭头(0x1a)呢 求大神们,帮帮忙

为什么解组此API响应会返回意外的EOF?

<div class="post-text" itemprop="text"> <h2>Problem</h2> <p>I'm creating a microservice in Go, using protocol buffers and gRPC. It interacts with a third-party API (Snooth) and I'm trying to unmarshal the JSON response into a protobuf struct I've created, using the <code>proto</code> package.</p> <p>Unmarshalling returns an <code>unexpected EOF</code> error.</p> <h2>What I've Tried</h2> <ul> <li>Using <code>json.newDecoder</code> instead of <code>json.unmarshal</code></li> <li><code>jsonpb.Unmarshal</code> instead of <code>proto.Unmarshal</code> (returns a <code>bad value in StructValue for key</code> error)</li> <li>Limiting the response read with <code>io.LimitReader</code></li> </ul> <p>I've also read something about prefixing the proto types with a size tag or something? But I'm not sure what that is or if it's relevant. Here's the repo on <a href="https://github.com/lukeic/vinogo/tree/feature/snooth/snooth" rel="nofollow noreferrer">Github</a>.</p> <h2>Question</h2> <p>What is causing this <code>unexpected EOF</code> error and how do I fix it, so that the API response is successfully unmarshalled into the proto struct?</p> <p>Side note: I am new to Go and would also appreciate any feedback/improvements on the following code. Thanks!</p> <h2>Code</h2> <p><code>Proto</code></p> <pre><code>message Response { message Meta { int32 results = 1; int32 returned = 2; string errmsg = 3; int32 status = 4; } Meta meta = 1; repeated google.protobuf.Struct wines = 2; repeated google.protobuf.Struct actions = 3; } </code></pre> <p><code>main.go</code></p> <pre><code>func fetchFromSnooth(e string, qs string, c chan response) { defer func() { if r := recover(); r != nil { log.Printf("Error fetching from Snooth: %s", r) errmsg := fmt.Sprint(r) c &lt;- response{nil, snoothApiError{errmsg}} } }() v := url.Values{"akey": {os.Getenv("SNOOTH_API_KEY")}} requestUrl := fmt.Sprintf("%s%s/?%s%s", snoothRoot, e, v.Encode(), qs) log.Printf("Fetching: %s", requestUrl) res, err := httpClient.Get(requestUrl) if err != nil { panic(err) } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { panic(err) } result := &amp;pb.Response{} if err := proto.Unmarshal(body, result); err != nil { panic(err) } c &lt;- response{result, snoothApiError{""}} } func (s *snoothApiService) searchWines(params *pb.Parameters_WineSearch) response { c := make(chan response) defer close(c) v := url.Values{} go fetchFromSnooth("wines", v.Encode(), c) return &lt;-c } func main() { snooth := snoothApiService{} resp := snooth.searchWines(nil) fmt.Println(resp) } </code></pre> <h2>Edit</h2> <p>Here's an example of the type of API response I'm trying to unmarshal: </p> <pre><code> { "meta": { "results": 1489442, "returned": 5, "errmsg": "", "status": 1 }, "wines": [ { "name": "Conway Deep Sea Chardonnay la Costa Wine Co", "code": "conway-deep-sea-chardonnay-la-costa-wine-co-2008-1", "region": "USA &gt; California &gt; Central Coast", "winery": "Conway Family Wines", "winery_id": "conway-family-wines", "varietal": "Chardonnay", "price": "21.99", "vintage": "2008", "type": "White Wine", "link": "http:\/\/www.snooth.com\/wine\/conway-deep-sea-chardonnay-la-costa-wine-co-2008-1\/", "tags": "", "image": "https:\/\/ei.isnooth.com\/multimedia\/0\/2\/8\/image_787698_square.jpeg", "snoothrank": 3, "available": 0, "num_merchants": 0, "num_reviews": 10 }, { "name": "Olmaia Cabernet di Toscana", "code": "olmaia-cabernet-di-toscana", "region": "Italy &gt; Tuscany &gt; Toscana Igt", "winery": "Col D Orcia", "winery_id": "col-d-orcia", "varietal": "Cabernet Sauvignon", "price": "0.00", "vintage": "", "type": "Red Wine", "link": "http:\/\/www.snooth.com\/wine\/olmaia-cabernet-di-toscana\/", "tags": "", "image": "https:\/\/ei.isnooth.com\/multimedia\/d\/e\/e\/image_790198_square.jpeg", "snoothrank": 3.5, "available": 0, "num_merchants": 0, "num_reviews": 25 }, { "name": "Dominio Dostares Prieto Picudo Vino de la Tierra de Castilla Y León Cumal", "code": "dominio-dostares-prieto-picudo-vino-de-la-tierra-de-castilla-y-leon-cumal-2006", "region": "Spain &gt; Castilla y León &gt; Vino de la Tierra de Castilla y León", "winery": "Bischöfliches Priesterseminar Trier", "winery_id": "bischofliches-priesterseminar-trier", "varietal": "Prieto Picudo", "price": "15.89", "vintage": "2006", "type": "Red Wine", "link": "http:\/\/www.snooth.com\/wine\/dominio-dostares-prieto-picudo-vino-de-la-tierra-de-castilla-y-leon-cumal-2006\/", "tags": "", "image": "https:\/\/ei.isnooth.com\/multimedia\/d\/0\/4\/image_336595_square.jpeg", "snoothrank": "n\/a", "available": 0, "num_merchants": 0, "num_reviews": 1 }, { "name": "Dominio Dostares Prieto Picudo Vino de la Tierra de Castilla Y León Cumal", "code": "dominio-dostares-prieto-picudo-vino-de-la-tierra-de-castilla-y-leon-cumal-2005", "region": "Spain &gt; Castilla y León &gt; Vino de la Tierra de Castilla y León", "winery": "Bischöfliches Priesterseminar Trier", "winery_id": "bischofliches-priesterseminar-trier", "varietal": "Prieto Picudo", "price": "38.99", "vintage": "2005", "type": "Red Wine", "link": "http:\/\/www.snooth.com\/wine\/dominio-dostares-prieto-picudo-vino-de-la-tierra-de-castilla-y-leon-cumal-2005\/", "tags": "", "image": "https:\/\/ei.isnooth.com\/multimedia\/1\/d\/a\/image_336596_square.jpeg", "snoothrank": "n\/a", "available": 0, "num_merchants": 0, "num_reviews": 1 }, { "name": "The Little Penguin Chardonnay Premier", "code": "the-little-penguin-chardonnay-premier-2010", "region": "South East Australia", "winery": "The Little Penguin", "winery_id": "the-little-penguin", "varietal": "Chardonnay", "price": "11.99", "vintage": "2010", "type": "White Wine", "link": "http:\/\/www.snooth.com\/wine\/the-little-penguin-chardonnay-premier-2010\/", "tags": "", "image": "https:\/\/ei.isnooth.com\/multimedia\/2\/c\/4\/image_826282_square.jpeg", "snoothrank": "n\/a", "available": 0, "num_merchants": 0, "num_reviews": 7 } ] } </code></pre> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

立即提问
相关内容推荐