Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: net/server/http_server_unittest.cc

Issue 2235973002: Add a SetDoNotFragment() method to DatagramSocket, and call this for (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blimp Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/server/http_server.h" 5 #include "net/server/http_server.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 int Write(IOBuffer* buf, 539 int Write(IOBuffer* buf,
540 int buf_len, 540 int buf_len,
541 const CompletionCallback& callback) override { 541 const CompletionCallback& callback) override {
542 return ERR_NOT_IMPLEMENTED; 542 return ERR_NOT_IMPLEMENTED;
543 } 543 }
544 int SetReceiveBufferSize(int32_t size) override { 544 int SetReceiveBufferSize(int32_t size) override {
545 return ERR_NOT_IMPLEMENTED; 545 return ERR_NOT_IMPLEMENTED;
546 } 546 }
547 int SetSendBufferSize(int32_t size) override { return ERR_NOT_IMPLEMENTED; } 547 int SetSendBufferSize(int32_t size) override { return ERR_NOT_IMPLEMENTED; }
548 548
549 int SetDoNotFragment(bool do_not_fragment) override {
550 return ERR_NOT_IMPLEMENTED;
551 }
552
549 void DidRead(const char* data, int data_len) { 553 void DidRead(const char* data, int data_len) {
550 if (!read_buf_.get()) { 554 if (!read_buf_.get()) {
551 pending_read_data_.append(data, data_len); 555 pending_read_data_.append(data, data_len);
552 return; 556 return;
553 } 557 }
554 int read_len = std::min(data_len, read_buf_len_); 558 int read_len = std::min(data_len, read_buf_len_);
555 memcpy(read_buf_->data(), data, read_len); 559 memcpy(read_buf_->data(), data, read_len);
556 pending_read_data_.assign(data + read_len, data_len - read_len); 560 pending_read_data_.assign(data + read_len, data_len - read_len);
557 read_buf_ = NULL; 561 read_buf_ = NULL;
558 read_buf_len_ = 0; 562 read_buf_len_ = 0;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 ASSERT_THAT(client.ConnectAndWait(server_address_), IsOk()); 657 ASSERT_THAT(client.ConnectAndWait(server_address_), IsOk());
654 client.Send("GET / HTTP/1.1\r\n\r\n"); 658 client.Send("GET / HTTP/1.1\r\n\r\n");
655 ASSERT_FALSE(RunUntilRequestsReceived(1)); 659 ASSERT_FALSE(RunUntilRequestsReceived(1));
656 ASSERT_EQ(1ul, connection_ids_.size()); 660 ASSERT_EQ(1ul, connection_ids_.size());
657 ASSERT_EQ(0ul, requests_.size()); 661 ASSERT_EQ(0ul, requests_.size());
658 } 662 }
659 663
660 } // namespace 664 } // namespace
661 665
662 } // namespace net 666 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698