PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux package net import ( "io" "log" "os" "os/exec" "strconv" "sync" "testing" "time" ) func TestSplice(t *testing.T) { t.Run("tcp-to-tcp", func(t *testing.T) { testSplice(t, "tcp", "tcp") }) if !testableNetwork("unixgram") { t.Skip("skipping unix-to-tcp tests") } t.Run("unix-to-tcp", func(t *testing.T) { testSplice(t, "unix", "tcp") }) t.Run("tcp-to-unix", func(t *testing.T) { testSplice(t, "tcp", "unix") }) t.Run("tcp-to-file", func(t *testing.T) { testSpliceToFile(t, "tcp", "file") }) t.Run("unix-to-file", func(t *testing.T) { testSpliceToFile(t, "unix", "file") }) t.Run("no-unixpacket", testSpliceNoUnixpacket) t.Run("no-unixgram", testSpliceNoUnixgram) } func testSpliceToFile(t *testing.T, upNet, downNet string) { t.Run("simple", spliceTestCase{upNet, downNet, 128, 128, 0}.testFile) t.Run("multipleWrite", spliceTestCase{upNet, downNet, 4096, 1 << 20, 0}.testFile) t.Run("big", spliceTestCase{upNet, downNet, 5 << 20, 1 << 30, 0}.testFile) t.Run("honorsLimitedReader", spliceTestCase{upNet, downNet, 4096, 1 << 20, 1 << 10}.testFile) t.Run("updatesLimitedReaderN", spliceTestCase{upNet, downNet, 1024, 4096, 4096 + 100}.testFile) t.Run("limitedReaderAtLimit", spliceTestCase{upNet, downNet, 32, 128, 128}.testFile) } func testSplice(t *testing.T, upNet, downNet string) { t.Run("simple", spliceTestCase{upNet, downNet, 128, 128, 0}.test) t.Run("multipleWrite", spliceTestCase{upNet, downNet, 4096, 1 << 20, 0}.test) t.Run("big", spliceTestCase{upNet, downNet, 5 << 20, 1 << 30, 0}.test) t.Run("honorsLimitedReader", spliceTestCase{upNet, downNet, 4096, 1 << 20, 1 << 10}.test) t.Run("updatesLimitedReaderN", spliceTestCase{upNet, downNet, 1024, 4096, 4096 + 100}.test) t.Run("limitedReaderAtLimit", spliceTestCase{upNet, downNet, 32, 128, 128}.test) t.Run("readerAtEOF", func(t *testing.T) { testSpliceReaderAtEOF(t, upNet, downNet) }) t.Run("issue25985", func(t *testing.T) { testSpliceIssue25985(t, upNet, downNet) }) } type spliceTestCase struct { upNet, downNet string chunkSize, totalSize int limitReadSize int } func (tc spliceTestCase) test(t *testing.T) { clientUp, serverUp := spliceTestSocketPair(t, tc.upNet) defer serverUp.Close() cleanup, err := startSpliceClient(clientUp, "w", tc.chunkSize, tc.totalSize) if err != nil { t.Fatal(err) } defer cleanup() clientDown, serverDown := spliceTestSocketPair(t, tc.downNet) defer serverDown.Close() cleanup, err = startSpliceClient(clientDown, "r", tc.chunkSize, tc.totalSize) if err != nil { t.Fatal(err) } defer cleanup() var ( r io.Reader = serverUp size = tc.totalSize ) if tc.limitReadSize > 0 { if tc.limitReadSize < size { size = tc.limitReadSize } r = &io.LimitedReader{ N: int64(tc.limitReadSize), R: serverUp, } defer serverUp.Close() } n, err := io.Copy(serverDown, r) serverDown.Close() if err != nil { t.Fatal(err) } if want := int64(size); want != n { t.Errorf("want %d bytes spliced, got %d", want, n) } if tc.limitReadSize > 0 { wantN := 0 if tc.limitReadSize > size { wantN = tc.limitReadSize - size } if n := r.(*io.LimitedReader).N; n != int64(wantN) { t.Errorf("r.N = %d, want %d", n, wantN) } } } func (tc spliceTestCase) testFile(t *testing.T) { f, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0) if err != nil { t.Fatal(err) } defer f.Close() client, server := spliceTestSocketPair(t, tc.upNet) defer server.Close() cleanup, err := startSpliceClient(client, "w", tc.chunkSize, tc.totalSize) if err != nil { client.Close() t.Fatal("failed to start splice client:", err) } defer cleanup() var ( r io.Reader = server actualSize = tc.totalSize ) if tc.limitReadSize > 0 { if tc.limitReadSize < actualSize { actualSize = tc.limitReadSize } r = &io.LimitedReader{ N: int64(tc.limitReadSize), R: r, } } got, err := io.Copy(f, r) if err != nil { t.Fatalf("failed to ReadFrom with error: %v", err) } if want := int64(actualSize); got != want { t.Errorf("got %d bytes, want %d", got, want) } if tc.limitReadSize > 0 { wantN := 0 if tc.limitReadSize > actualSize { wantN = tc.limitReadSize - actualSize } if gotN := r.(*io.LimitedReader).N; gotN != int64(wantN) { t.Errorf("r.N = %d, want %d", gotN, wantN) } } } func testSpliceReaderAtEOF(t *testing.T, upNet, downNet string) { // UnixConn doesn't implement io.ReaderFrom, which will fail // the following test in asserting a UnixConn to be an io.ReaderFrom, // so skip this test. if upNet == "unix" || downNet == "unix" { t.Skip("skipping test on unix socket") } clientUp, serverUp := spliceTestSocketPair(t, upNet) defer clientUp.Close() clientDown, serverDown := spliceTestSocketPair(t, downNet) defer clientDown.Close() serverUp.Close() // We'd like to call net.spliceFrom here and check the handled return // value, but we disable splice on old Linux kernels. // // In that case, poll.Splice and net.spliceFrom return a non-nil error // and handled == false. We'd ideally like to see handled == true // because the source reader is at EOF, but if we're running on an old // kernel, and splice is disabled, we won't see EOF from net.spliceFrom, // because we won't touch the reader at all. // // Trying to untangle the errors from net.spliceFrom and match them // against the errors created by the poll package would be brittle, // so this is a higher level test. // // The following ReadFrom should return immediately, regardless of // whether splice is disabled or not. The other side should then // get a goodbye signal. Test for the goodbye signal. msg := "bye" go func() { serverDown.(io.ReaderFrom).ReadFrom(serverUp) io.WriteString(serverDown, msg) serverDown.Close() }() buf := make([]byte, 3) _, err := io.ReadFull(clientDown, buf) if err != nil { t.Errorf("clientDown: %v", err) } if string(buf) != msg { t.Errorf("clientDown got %q, want %q", buf, msg) } } func testSpliceIssue25985(t *testing.T, upNet, downNet string) { front := newLocalListener(t, upNet) defer front.Close() back := newLocalListener(t, downNet) defer back.Close() var wg sync.WaitGroup wg.Add(2) proxy := func() { src, err := front.Accept() if err != nil { return } dst, err := Dial(downNet, back.Addr().String()) if err != nil { return } defer dst.Close() defer src.Close() go func() { io.Copy(src, dst) wg.Done() }() go func() { io.Copy(dst, src) wg.Done() }() } go proxy() toFront, err := Dial(upNet, front.Addr().String()) if err != nil { t.Fatal(err) } io.WriteString(toFront, "foo") toFront.Close() fromProxy, err := back.Accept() if err != nil { t.Fatal(err) } defer fromProxy.Close() _, err = io.ReadAll(fromProxy) if err != nil { t.Fatal(err) } wg.Wait() } func testSpliceNoUnixpacket(t *testing.T) { clientUp, serverUp := spliceTestSocketPair(t, "unixpacket") defer clientUp.Close() defer serverUp.Close() clientDown, serverDown := spliceTestSocketPair(t, "tcp") defer clientDown.Close() defer serverDown.Close() // If splice called poll.Splice here, we'd get err == syscall.EINVAL // and handled == false. If poll.Splice gets an EINVAL on the first // try, it assumes the kernel it's running on doesn't support splice // for unix sockets and returns handled == false. This works for our // purposes by somewhat of an accident, but is not entirely correct. // // What we want is err == nil and handled == false, i.e. we never // called poll.Splice, because we know the unix socket's network. _, err, handled := spliceFrom(serverDown.(*TCPConn).fd, serverUp) if err != nil || handled != false { t.Fatalf("got err = %v, handled = %t, want nil error, handled == false", err, handled) } } func testSpliceNoUnixgram(t *testing.T) { addr, err := ResolveUnixAddr("unixgram", testUnixAddr(t)) if err != nil { t.Fatal(err) } defer os.Remove(addr.Name) up, err := ListenUnixgram("unixgram", addr) if err != nil { t.Fatal(err) } defer up.Close() clientDown, serverDown := spliceTestSocketPair(t, "tcp") defer clientDown.Close() defer serverDown.Close() // Analogous to testSpliceNoUnixpacket. _, err, handled := spliceFrom(serverDown.(*TCPConn).fd, up) if err != nil || handled != false { t.Fatalf("got err = %v, handled = %t, want nil error, handled == false", err, handled) } } func BenchmarkSplice(b *testing.B) { testHookUninstaller.Do(uninstallTestHooks) b.Run("tcp-to-tcp", func(b *testing.B) { benchSplice(b, "tcp", "tcp") }) b.Run("unix-to-tcp", func(b *testing.B) { benchSplice(b, "unix", "tcp") }) b.Run("tcp-to-unix", func(b *testing.B) { benchSplice(b, "tcp", "unix") }) } func benchSplice(b *testing.B, upNet, downNet string) { for i := 0; i <= 10; i++ { chunkSize := 1 << uint(i+10) tc := spliceTestCase{ upNet: upNet, downNet: downNet, chunkSize: chunkSize, } b.Run(strconv.Itoa(chunkSize), tc.bench) } } func (tc spliceTestCase) bench(b *testing.B) { // To benchmark the genericReadFrom code path, set this to false. useSplice := true clientUp, serverUp := spliceTestSocketPair(b, tc.upNet) defer serverUp.Close() cleanup, err := startSpliceClient(clientUp, "w", tc.chunkSize, tc.chunkSize*b.N) if err != nil { b.Fatal(err) } defer cleanup() clientDown, serverDown := spliceTestSocketPair(b, tc.downNet) defer serverDown.Close() cleanup, err = startSpliceClient(clientDown, "r", tc.chunkSize, tc.chunkSize*b.N) if err != nil { b.Fatal(err) } defer cleanup() b.SetBytes(int64(tc.chunkSize)) b.ResetTimer() if useSplice { _, err := io.Copy(serverDown, serverUp) if err != nil { b.Fatal(err) } } else { type onlyReader struct { io.Reader } _, err := io.Copy(serverDown, onlyReader{serverUp}) if err != nil { b.Fatal(err) } } } func spliceTestSocketPair(t testing.TB, net string) (client, server Conn) { t.Helper() ln := newLocalListener(t, net) defer ln.Close() var cerr, serr error acceptDone := make(chan struct{}) go func() { server, serr = ln.Accept() acceptDone <- struct{}{} }() client, cerr = Dial(ln.Addr().Network(), ln.Addr().String()) <-acceptDone if cerr != nil { if server != nil { server.Close() } t.Fatal(cerr) } if serr != nil { if client != nil { client.Close() } t.Fatal(serr) } return client, server } func startSpliceClient(conn Conn, op string, chunkSize, totalSize int) (func(), error) { f, err := conn.(interface{ File() (*os.File, error) }).File() if err != nil { return nil, err } cmd := exec.Command(os.Args[0], os.Args[1:]...) cmd.Env = []string{ "GO_NET_TEST_SPLICE=1", "GO_NET_TEST_SPLICE_OP=" + op, "GO_NET_TEST_SPLICE_CHUNK_SIZE=" + strconv.Itoa(chunkSize), "GO_NET_TEST_SPLICE_TOTAL_SIZE=" + strconv.Itoa(totalSize), "TMPDIR=" + os.Getenv("TMPDIR"), } cmd.ExtraFiles = append(cmd.ExtraFiles, f) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Start(); err != nil { return nil, err } donec := make(chan struct{}) go func() { cmd.Wait() conn.Close() f.Close() close(donec) }() return func() { select { case <-donec: case <-time.After(5 * time.Second): log.Printf("killing splice client after 5 second shutdown timeout") cmd.Process.Kill() select { case <-donec: case <-time.After(5 * time.Second): log.Printf("splice client didn't die after 10 seconds") } } }, nil } func init() { if os.Getenv("GO_NET_TEST_SPLICE") == "" { return } defer os.Exit(0) f := os.NewFile(uintptr(3), "splice-test-conn") defer f.Close() conn, err := FileConn(f) if err != nil { log.Fatal(err) } var chunkSize int if chunkSize, err = strconv.Atoi(os.Getenv("GO_NET_TEST_SPLICE_CHUNK_SIZE")); err != nil { log.Fatal(err) } buf := make([]byte, chunkSize) var totalSize int if totalSize, err = strconv.Atoi(os.Getenv("GO_NET_TEST_SPLICE_TOTAL_SIZE")); err != nil { log.Fatal(err) } var fn func([]byte) (int, error) switch op := os.Getenv("GO_NET_TEST_SPLICE_OP"); op { case "r": fn = conn.Read case "w": defer conn.Close() fn = conn.Write default: log.Fatalf("unknown op %q", op) } var n int for count := 0; count < totalSize; count += n { if count+chunkSize > totalSize { buf = buf[:totalSize-count] } var err error if n, err = fn(buf); err != nil { return } } } func BenchmarkSpliceFile(b *testing.B) { b.Run("tcp-to-file", func(b *testing.B) { benchmarkSpliceFile(b, "tcp") }) b.Run("unix-to-file", func(b *testing.B) { benchmarkSpliceFile(b, "unix") }) } func benchmarkSpliceFile(b *testing.B, proto string) { for i := 0; i <= 10; i++ { size := 1 << (i + 10) bench := spliceFileBench{ proto: proto, chunkSize: size, } b.Run(strconv.Itoa(size), bench.benchSpliceFile) } } type spliceFileBench struct { proto string chunkSize int } func (bench spliceFileBench) benchSpliceFile(b *testing.B) { f, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0) if err != nil { b.Fatal(err) } defer f.Close() totalSize := b.N * bench.chunkSize client, server := spliceTestSocketPair(b, bench.proto) defer server.Close() cleanup, err := startSpliceClient(client, "w", bench.chunkSize, totalSize) if err != nil { client.Close() b.Fatalf("failed to start splice client: %v", err) } defer cleanup() b.ReportAllocs() b.SetBytes(int64(bench.chunkSize)) b.ResetTimer() got, err := io.Copy(f, server) if err != nil { b.Fatalf("failed to ReadFrom with error: %v", err) } if want := int64(totalSize); got != want { b.Errorf("bytes sent mismatch, got: %d, want: %d", got, want) } }